mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
wc: Don't read() if we only need to count number of bytes (Version 2) (#1851)
* wc: Don't read() if we only need to count number of bytes * Resolve a few code review comments * Use write macros instead of print * Fix wc tests in case only one thing is printed * wc: Fix style * wc: Use return value of first splice rather than second * wc: Make main loop more readable * wc: Don't unwrap on failed write to stdout * wc: Increment error count when stats fail to print * Re-add Cargo.lock
This commit is contained in:
parent
3e06882acc
commit
698dab12a6
5 changed files with 1382 additions and 1152 deletions
|
@ -25,7 +25,7 @@ fn test_stdin_line_len_regression() {
|
|||
.args(&["-L"])
|
||||
.pipe_in("\n123456")
|
||||
.run()
|
||||
.stdout_is(" 6\n");
|
||||
.stdout_is("6\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -34,7 +34,7 @@ fn test_stdin_only_bytes() {
|
|||
.args(&["-c"])
|
||||
.pipe_in_fixture("lorem_ipsum.txt")
|
||||
.run()
|
||||
.stdout_is(" 772\n");
|
||||
.stdout_is("772\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -59,7 +59,7 @@ fn test_single_only_lines() {
|
|||
new_ucmd!()
|
||||
.args(&["-l", "moby_dick.txt"])
|
||||
.run()
|
||||
.stdout_is(" 18 moby_dick.txt\n");
|
||||
.stdout_is("18 moby_dick.txt\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue