Skip to content

Commit

Permalink
Add test 'grid_for_file_without_newline' (for issue sharkdp#299 fix)
Browse files Browse the repository at this point in the history
This is a regression test for the fix for issue sharkdp#299. If that fix is
reverted, currently only one test ('header_padding') fails. But that
test is for a different use case, so add a dedicated regression test for
the particular use case issue sharkdp#299 is about.
  • Loading branch information
Enselic authored and sharkdp committed Dec 21, 2020
1 parent e0207f8 commit a63bb08
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -827,3 +827,27 @@ fn plain_mode_does_not_add_nonexisting_newline() {
.stdout("Single Line");
}

// Regression test for https://github.com/sharkdp/bat/issues/299
#[test]
fn grid_for_file_without_newline() {
bat()
.arg("--paging=never")
.arg("--color=never")
.arg("--terminal-width=80")
.arg("--wrap=never")
.arg("--decorations=always")
.arg("--style=full")
.arg("single-line.txt")
.assert()
.success()
.stdout(
"\
───────┬────────────────────────────────────────────────────────────────────────
│ File: single-line.txt
───────┼────────────────────────────────────────────────────────────────────────
1 │ Single Line
───────┴────────────────────────────────────────────────────────────────────────
",
)
.stderr("");
}

0 comments on commit a63bb08

Please sign in to comment.