1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-01 13:37:48 +00:00

sort: insert line separators after non-empty files

If files don't end witht a line separator we have to insert one,
otherwise the last line will be combined with the first line of the next
file.
This commit is contained in:
Michael Debertol 2021-06-06 11:31:42 +02:00
parent 2dd6824e76
commit 66359a0f56
4 changed files with 28 additions and 3 deletions

View file

@ -792,3 +792,11 @@ fn test_nonexistent_file() {
fn test_blanks() {
test_helper("blanks", &["-b", "--ignore-blanks"]);
}
#[test]
fn sort_multiple() {
new_ucmd!()
.args(&["no_trailing_newline1.txt", "no_trailing_newline2.txt"])
.succeeds()
.stdout_is("a\nb\nb\n");
}

View file

@ -0,0 +1,2 @@
a
b

View file

@ -0,0 +1 @@
b