1
0
mirror of https://github.com/sharkdp/bat synced 2026-06-09 10:03:18 +00:00

Merge branch 'master' into fix/warn-missing-pager

This commit is contained in:
Keith Hall
2026-02-20 20:37:07 +02:00
committed by GitHub
3 changed files with 52 additions and 11 deletions
+38
View File
@@ -2900,6 +2900,44 @@ fn no_wrapping_with_chop_long_lines() {
wrapping_test("--chop-long-lines", false);
}
#[test]
#[serial]
fn wrap_never_flag_respected_with_paging_always() {
mocked_pagers::with_mocked_versions_of_more_and_most_in_path(|| {
bat()
.arg("--pager=cat")
.arg("--paging=always")
.arg("--wrap=never")
.arg("--color=never")
.arg("--decorations=never")
.arg("--style=plain")
.write_stdin("abcdefghigklmnopqrstuvxyzabcdefghigklmnopqrstuvxyzabcdefghigklmnopqrstuvxyzabcdefghigklmnopqrstuvxyz\n")
.assert()
.success()
.stdout(predicate::str::contains("abcdefghigklmnopqrstuvxyzabcdefghigklmnopqrstuvxyzabcdefghigklmnopqrstuvxyzabcdefghigklmnopqrstuvxyz").normalize())
.stderr("");
});
}
#[test]
#[serial]
fn s_flag_respected_with_paging_always() {
mocked_pagers::with_mocked_versions_of_more_and_most_in_path(|| {
bat()
.arg("--pager=cat")
.arg("--paging=always")
.arg("-S")
.arg("--color=never")
.arg("--decorations=never")
.arg("--style=plain")
.write_stdin("abcdefghigklmnopqrstuvxyzabcdefghigklmnopqrstuvxyzabcdefghigklmnopqrstuvxyzabcdefghigklmnopqrstuvxyz\n")
.assert()
.success()
.stdout(predicate::str::contains("abcdefghigklmnopqrstuvxyzabcdefghigklmnopqrstuvxyzabcdefghigklmnopqrstuvxyzabcdefghigklmnopqrstuvxyz").normalize())
.stderr("");
});
}
#[test]
fn theme_arg_overrides_env() {
bat()