mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-30 04:27:45 +00:00
tests/common/util: Add test which provokes the broken pipe error
This commit is contained in:
parent
70714bc3cd
commit
e860eb899e
1 changed files with 18 additions and 0 deletions
|
@ -1828,4 +1828,22 @@ mod tests {
|
||||||
println!("TEST SKIPPED (cannot run inside CI)");
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue