From 9ccb667653ca2e8e6243becc9312ca30dc2ce989 Mon Sep 17 00:00:00 2001 From: Martin Nordholts Date: Tue, 5 Jan 2021 10:14:30 +0100 Subject: [PATCH] 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. --- tests/integration_tests.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index e16a8a91..7ab99bb2 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -522,6 +522,17 @@ fn alias_pager_disable_long_overrides_short() { .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] fn config_location_test() { bat_with_config()