Add tests against issue #2731

This commit is contained in:
einfachIrgendwer0815 2023-10-21 22:16:59 +02:00
parent fd6c7637e4
commit e667415def
No known key found for this signature in database
GPG Key ID: 58D55E5F117DA873

View File

@ -1020,6 +1020,31 @@ fn enable_pager_if_pp_flag_comes_before_paging() {
.stdout(predicate::eq("pager-output\n").normalize());
}
#[test]
fn paging_does_not_override_simple_plain() {
bat()
.env("PAGER", "echo pager-output")
.arg("--decorations=always")
.arg("--plain")
.arg("--paging=never")
.arg("test.txt")
.assert()
.success()
.stdout(predicate::eq("hello world\n"));
}
#[test]
fn simple_plain_does_not_override_paging() {
bat()
.env("PAGER", "echo pager-output")
.arg("--paging=always")
.arg("--plain")
.arg("test.txt")
.assert()
.success()
.stdout(predicate::eq("pager-output\n"));
}
#[test]
fn pager_failed_to_parse() {
bat()