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

paste: support multi-stdin (#1791)

- added `-` as the default input, since `paste` reads stdin if no file
is provided
- `paste` also supports providing `-` multiple times
- added a test for it
This commit is contained in:
Ali 2021-03-10 14:19:12 -08:00 committed by GitHub
parent 734ef0a8a1
commit 374a4fde86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 49 additions and 11 deletions

View file

@ -2,8 +2,23 @@ use crate::common::util::*;
#[test]
fn test_combine_pairs_of_lines() {
new_ucmd!()
.args(&["-s", "-d", "\t\n", "html_colors.txt"])
.run()
.stdout_is_fixture("html_colors.expected");
for s in vec!["-s", "--serial"] {
for d in vec!["-d", "--delimiters"] {
new_ucmd!()
.args(&[s, d, "\t\n", "html_colors.txt"])
.run()
.stdout_is_fixture("html_colors.expected");
}
}
}
#[test]
fn test_multi_stdin() {
for d in vec!["-d", "--delimiters"] {
new_ucmd!()
.args(&[d, "\t\n", "-", "-"])
.pipe_in_fixture("html_colors.txt")
.succeeds()
.stdout_is_fixture("html_colors.expected");
}
}