|
|
@ -7,6 +7,8 @@ fn bat() -> Command {
|
|
|
|
let mut cmd = Command::main_binary().unwrap();
|
|
|
|
let mut cmd = Command::main_binary().unwrap();
|
|
|
|
cmd.current_dir("tests/examples");
|
|
|
|
cmd.current_dir("tests/examples");
|
|
|
|
cmd.arg("--no-config");
|
|
|
|
cmd.arg("--no-config");
|
|
|
|
|
|
|
|
cmd.env_remove("PAGER");
|
|
|
|
|
|
|
|
cmd.env_remove("BAT_PAGER");
|
|
|
|
cmd
|
|
|
|
cmd
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -113,3 +115,38 @@ fn do_not_exit_directory() {
|
|
|
|
.stdout("hello world\n")
|
|
|
|
.stdout("hello world\n")
|
|
|
|
.failure();
|
|
|
|
.failure();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
|
|
|
fn pager_basic() {
|
|
|
|
|
|
|
|
bat()
|
|
|
|
|
|
|
|
.env("PAGER", "echo pager-output")
|
|
|
|
|
|
|
|
.arg("--paging=always")
|
|
|
|
|
|
|
|
.arg("test.txt")
|
|
|
|
|
|
|
|
.assert()
|
|
|
|
|
|
|
|
.success()
|
|
|
|
|
|
|
|
.stdout("pager-output\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
|
|
|
fn pager_overwrite() {
|
|
|
|
|
|
|
|
bat()
|
|
|
|
|
|
|
|
.env("PAGER", "echo other-pager")
|
|
|
|
|
|
|
|
.env("BAT_PAGER", "echo pager-output")
|
|
|
|
|
|
|
|
.arg("--paging=always")
|
|
|
|
|
|
|
|
.arg("test.txt")
|
|
|
|
|
|
|
|
.assert()
|
|
|
|
|
|
|
|
.success()
|
|
|
|
|
|
|
|
.stdout("pager-output\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
|
|
|
fn pager_disable() {
|
|
|
|
|
|
|
|
bat()
|
|
|
|
|
|
|
|
.env("PAGER", "echo other-pager")
|
|
|
|
|
|
|
|
.env("BAT_PAGER", "")
|
|
|
|
|
|
|
|
.arg("--paging=always")
|
|
|
|
|
|
|
|
.arg("test.txt")
|
|
|
|
|
|
|
|
.assert()
|
|
|
|
|
|
|
|
.success()
|
|
|
|
|
|
|
|
.stdout("hello world\n");
|
|
|
|
|
|
|
|
}
|
|
|
|