Skip to content

Commit

Permalink
Add integration tests running bat with empty input files.
Browse files Browse the repository at this point in the history
  • Loading branch information
reidwagner authored and sharkdp committed Feb 8, 2019
1 parent a16789a commit cec9cc0
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
Empty file added tests/examples/empty.txt
Empty file.
52 changes: 52 additions & 0 deletions tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,58 @@ fn concatenate_stdin() {
.stdout("hello world\nstdin\nhello world\n");
}

#[test]
fn concatenate_empty_first() {
bat()
.arg("empty.txt")
.arg("test.txt")
.assert()
.success()
.stdout("hello world\n");
}

#[test]
fn concatenate_empty_last() {
bat()
.arg("test.txt")
.arg("empty.txt")
.assert()
.success()
.stdout("hello world\n");
}

#[test]
fn concatenate_empty_both() {
bat()
.arg("empty.txt")
.arg("empty.txt")
.assert()
.success()
.stdout("");
}

#[test]
fn concatenate_empty_between() {
bat()
.arg("test.txt")
.arg("empty.txt")
.arg("test.txt")
.assert()
.success()
.stdout("hello world\nhello world\n");
}

#[test]
fn concatenate_empty_first_and_last() {
bat()
.arg("empty.txt")
.arg("test.txt")
.arg("empty.txt")
.assert()
.success()
.stdout("hello world\n");
}

#[test]
fn line_numbers() {
bat()
Expand Down

0 comments on commit cec9cc0

Please sign in to comment.