mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
tr: Flush BufWriter
, fix double error context
Write errors led with `tr: tr: write error:`.
This commit is contained in:
parent
cf50952325
commit
181844eafa
3 changed files with 23 additions and 12 deletions
|
@ -1545,3 +1545,14 @@ fn test_non_digit_repeat() {
|
|||
.fails()
|
||||
.stderr_only("tr: invalid repeat count 'c' in [c*n] construct\n");
|
||||
}
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[test]
|
||||
fn test_failed_write_is_reported() {
|
||||
new_ucmd!()
|
||||
.pipe_in("hello")
|
||||
.args(&["e", "a"])
|
||||
.set_stdout(std::fs::File::create("/dev/full").unwrap())
|
||||
.fails()
|
||||
.stderr_is("tr: write error: No space left on device\n");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue