1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

tests/common/util: Add test which provokes the broken pipe error

This commit is contained in:
Joining7943 2022-09-08 19:13:49 +02:00 committed by Sylvestre Ledru
parent 70714bc3cd
commit e860eb899e

View file

@ -1828,4 +1828,22 @@ mod tests {
println!("TEST SKIPPED (cannot run inside CI)");
}
}
// This error was first detected when running tail so tail is used here but
// should fail with any command that takes piped input.
// See also https://github.com/uutils/coreutils/issues/3895
#[test]
fn test_when_piped_input_then_no_broken_pipe() {
let ts = TestScenario::new("tail");
for i in 0..10000 {
dbg!(i);
let test_string = "a\nb\n";
ts.ucmd()
.args(&["-n", "0"])
.pipe_in(test_string)
.succeeds()
.no_stdout()
.no_stderr();
}
}
}