1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 11:36:16 +00:00

Merge pull request #5306 from cakebaker/nl_fix_output_order_if_stdin_and_files_are_mixed

nl: fix output order if stdin and files are mixed
This commit is contained in:
Terts Diepraam 2023-09-24 12:12:54 +02:00 committed by GitHub
commit 4ca792d2ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 13 deletions

View file

@ -349,6 +349,19 @@ fn test_default_body_numbering_multiple_files() {
.stdout_is(" 1\ta\n 2\tb\n 3\tc\n");
}
#[test]
fn test_default_body_numbering_multiple_files_and_stdin() {
let (at, mut ucmd) = at_and_ucmd!();
at.write("a.txt", "a");
at.write("c.txt", "c");
ucmd.args(&["a.txt", "-", "c.txt"])
.pipe_in("b")
.succeeds()
.stdout_is(" 1\ta\n 2\tb\n 3\tc\n");
}
#[test]
fn test_body_numbering_all_lines_without_delimiter() {
for arg in ["-ba", "--body-numbering=a"] {