diff options
Diffstat (limited to 'tests/integration_tests.rs')
-rw-r--r-- | tests/integration_tests.rs | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs index b118c38f..aa5ca845 100644 --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -874,6 +874,42 @@ fn disable_pager_if_disable_paging_flag_comes_after_paging() { } #[test] +fn disable_pager_if_pp_flag_comes_after_paging() { + bat() + .env("PAGER", "echo pager-output") + .arg("--paging=always") + .arg("-pp") + .arg("test.txt") + .assert() + .success() + .stdout(predicate::eq("hello world\n").normalize()); +} + +#[test] +fn enable_pager_if_disable_paging_flag_comes_before_paging() { + bat() + .env("PAGER", "echo pager-output") + .arg("-P") + .arg("--paging=always") + .arg("test.txt") + .assert() + .success() + .stdout(predicate::eq("pager-output\n").normalize()); +} + +#[test] +fn enable_pager_if_pp_flag_comes_before_paging() { + bat() + .env("PAGER", "echo pager-output") + .arg("-pp") + .arg("--paging=always") + .arg("test.txt") + .assert() + .success() + .stdout(predicate::eq("pager-output\n").normalize()); +} + +#[test] fn pager_failed_to_parse() { bat() .env("BAT_PAGER", "mismatched-quotes 'a") |