Add test 'grid_for_file_without_newline' (for issue #299 fix)

This is a regression test for the fix for issue #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 #299 is about.
This commit is contained in:
Martin Nordholts 2020-12-21 17:00:14 +01:00 committed by David Peter
parent e0207f8167
commit a63bb08eda
1 changed files with 24 additions and 0 deletions

View File

@ -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("");
}