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

wc: emit '-' in ouput when set on command-line

When stdin is explicitly specified on the command-line with '-', emit it
in the output stats to match GNU wc output.

Fixes #2188.
This commit is contained in:
Nicolas Thery 2021-05-09 15:42:55 +02:00
parent d43af35147
commit 112b042769
3 changed files with 85 additions and 32 deletions

View file

@ -36,6 +36,15 @@ fn test_stdin_default() {
.stdout_is(" 13 109 772\n");
}
#[test]
fn test_stdin_explicit() {
new_ucmd!()
.pipe_in_fixture("lorem_ipsum.txt")
.arg("-")
.run()
.stdout_is(" 13 109 772 -\n");
}
#[test]
fn test_utf8() {
new_ucmd!()