1
0
mirror of https://github.com/sharkdp/bat.git synced 2026-02-08 00:32:08 +00:00

test: add integration tests for --quiet-empty flag

This commit is contained in:
dddffgg
2026-01-31 16:45:46 +08:00
parent 26118afde0
commit 6a7936a26f

View File

@@ -3654,3 +3654,33 @@ fn plain_with_sized_terminal_width() {
.stdout("hello \nworld\n") .stdout("hello \nworld\n")
.stderr(""); .stderr("");
} }
#[test]
fn quiet_empty_suppresses_output_on_empty_stdin() {
bat()
.arg("--quiet-empty")
.write_stdin("")
.assert()
.success()
.stdout("");
}
#[test]
fn quiet_empty_does_not_affect_non_empty_input() {
bat()
.arg("--quiet-empty")
.write_stdin("hello\n")
.assert()
.success()
.stdout("hello\n");
}
#[test]
fn quiet_empty_suppresses_output_on_empty_file() {
bat()
.arg("--quiet-empty")
.arg("empty.txt")
.assert()
.success()
.stdout("");
}