on master help sign in
Add integration tests running bat with empty input files.
cec9cc0Reid Wagner
tests/examples/empty.txtnew file

No changes to the content.

tests/integration_tests.rs+52
@@ -76,6 +76,58 @@ fn concatenate_stdin() {
76 .stdout("hello world\nstdin\nhello world\n");
76 .stdout("hello world\nstdin\nhello world\n");
77}
77}
78
78
79+#[test]
80+fn concatenate_empty_first() {
81+ bat()
82+ .arg("empty.txt")
83+ .arg("test.txt")
84+ .assert()
85+ .success()
86+ .stdout("hello world\n");
87+}
88+
89+#[test]
90+fn concatenate_empty_last() {
91+ bat()
92+ .arg("test.txt")
93+ .arg("empty.txt")
94+ .assert()
95+ .success()
96+ .stdout("hello world\n");
97+}
98+
99+#[test]
100+fn concatenate_empty_both() {
101+ bat()
102+ .arg("empty.txt")
103+ .arg("empty.txt")
104+ .assert()
105+ .success()
106+ .stdout("");
107+}
108+
109+#[test]
110+fn concatenate_empty_between() {
111+ bat()
112+ .arg("test.txt")
113+ .arg("empty.txt")
114+ .arg("test.txt")
115+ .assert()
116+ .success()
117+ .stdout("hello world\nhello world\n");
118+}
119+
120+#[test]
121+fn concatenate_empty_first_and_last() {
122+ bat()
123+ .arg("empty.txt")
124+ .arg("test.txt")
125+ .arg("empty.txt")
126+ .assert()
127+ .success()
128+ .stdout("hello world\n");
129+}
130+
79#[test]
131#[test]
80fn line_numbers() {
132fn line_numbers() {
81 bat()
133 bat()