2
0
mirror of https://github.com/sharkdp/bat synced 2024-11-18 15:26:16 +00:00

Add integration test for unparsable pager

Right now all tests pass even if we e.g. return

    Ok(OutputType::stdout())

instead of doing

    .chain_err(|| "Could not parse pager command.")?

so add a test to make sure this functionality don't break.
This commit is contained in:
Martin Nordholts 2021-01-05 10:14:30 +01:00 committed by David Peter
parent b600f62ab6
commit 9ccb667653

View File

@ -522,6 +522,17 @@ fn alias_pager_disable_long_overrides_short() {
.stdout(predicate::eq("pager-output\n").normalize()); .stdout(predicate::eq("pager-output\n").normalize());
} }
#[test]
fn pager_failed_to_parse() {
bat()
.env("BAT_PAGER", "mismatched-quotes 'a")
.arg("--paging=always")
.arg("test.txt")
.assert()
.failure()
.stderr(predicate::str::contains("Could not parse pager command"));
}
#[test] #[test]
fn config_location_test() { fn config_location_test() {
bat_with_config() bat_with_config()