1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

cat: remove all per-file state

cat cannot keep per-file state, so move all remaining state (one_blank_kept)
to the global state.
This commit is contained in:
Michael Debertol 2021-08-07 21:31:05 +02:00
parent 5be4c48546
commit 7229360217
2 changed files with 19 additions and 4 deletions

View file

@ -273,6 +273,18 @@ fn test_stdin_show_ends() {
.stdout_only("\t\0$\n\t");
}
}
#[test]
fn squeeze_all_files() {
// empty lines at the end of a file are "squeezed" together with empty lines at the beginning
let (at, mut ucmd) = at_and_ucmd!();
at.write("input1", "a\n\n");
at.write("input2", "\n\nb");
ucmd.args(&["input1", "input2", "-s"])
.succeeds()
.stdout_only("a\n\nb");
}
#[test]
fn test_show_ends_crlf() {
new_ucmd!()