on master help sign in
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.

commit9ccb667653ca2e8e6243becc9312ca30dc2ce989 authorMartin Nordholts <enselic@gmail.com> dateTue 5 Jan 2021, 10:14 (6 years ago) parentb600f62
1 file changed+11
tests/integration_tests.rs+11
tests/integration_tests.rs+11
@@ -522,6 +522,17 @@ fn alias_pager_disable_long_overrides_short() {
522522 .stdout(predicate::eq("pager-output\n").normalize());
523523}
524524
525+#[test]
526+fn pager_failed_to_parse() {
527+ bat()
528+ .env("BAT_PAGER", "mismatched-quotes 'a")
529+ .arg("--paging=always")
530+ .arg("test.txt")
531+ .assert()
532+ .failure()
533+ .stderr(predicate::str::contains("Could not parse pager command"));
534+}
535+
525536#[test]
526537fn config_location_test() {
527538 bat_with_config()