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

tr: Flush BufWriter, fix double error context

Write errors led with `tr: tr: write error:`.
This commit is contained in:
Jan Verbeek 2025-03-31 13:23:45 +02:00
parent cf50952325
commit 181844eafa
3 changed files with 23 additions and 12 deletions

View file

@ -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");
}