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

split: catch broken pipe error for round robin strategy

The broken pipe error is not handled in the case of the round robin
strategy (typically used with --filter).

Align to the other strategies to silence that error in that use case
too.

fixes #5191

Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
This commit is contained in:
Guillaume Ranquet 2023-09-06 16:07:59 +02:00
parent 2bcb3c2363
commit d4217c5a12
2 changed files with 22 additions and 4 deletions

View file

@ -299,6 +299,18 @@ fn test_filter_command_fails() {
.fails();
}
#[test]
#[cfg(unix)]
fn test_filter_broken_pipe() {
let (at, mut ucmd) = at_and_ucmd!();
let name = "filter-big-input";
RandomFile::new(&at, name).add_lines(1024 * 10);
ucmd
.args(&["--filter=head -c1 > /dev/null", "-n", "r/1", name])
.succeeds();
}
#[test]
fn test_split_lines_number() {
// Test if stdout/stderr for '--lines' option is correct