mirror of
https://github.com/sharkdp/bat
synced 2024-11-18 15:26:16 +00:00
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:
parent
e0207f8167
commit
a63bb08eda
@ -827,3 +827,27 @@ fn plain_mode_does_not_add_nonexisting_newline() {
|
|||||||
.stdout("Single Line");
|
.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("");
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user