1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

tr: handle broken pipe gracefully

This commit is contained in:
yuankunzhang 2025-07-02 22:26:11 +08:00
parent d04d0cd987
commit 31a5b54dc6
3 changed files with 27 additions and 7 deletions

View file

@ -1554,3 +1554,13 @@ fn test_failed_write_is_reported() {
.fails()
.stderr_is("tr: write error: No space left on device\n");
}
#[test]
fn test_broken_pipe_no_error() {
new_ucmd!()
.args(&["e", "a"])
.pipe_in("hello".repeat(100))
.run_stdout_starts_with(b"")
.success()
.stderr_is("");
}