on master help sign in
Add integration tests running bat with empty input files.
commitcec9cc073c477c0a664415b846fd7f2518c69ee3 authorReid Wagner <reid.ab.wagner@gmail.com> dateThu 7 Feb 2019, 19:27 (8 years ago) parenta16789a
2 files changed+52
tests/examples/empty.txt tests/integration_tests.rs+52
tests/examples/empty.txtnew file

No changes to the content.

tests/integration_tests.rs+52
@@ -76,6 +76,58 @@ fn concatenate_stdin() {
7676 .stdout("hello world\nstdin\nhello world\n");
7777}
7878
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+
79131#[test]
80132fn line_numbers() {
81133 bat()