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

cut: Flush BufWriter, centralize output file logic

This commit is contained in:
Jan Verbeek 2025-03-31 12:52:43 +02:00
parent 07cce029cb
commit cba48c0284
2 changed files with 44 additions and 20 deletions

View file

@ -375,3 +375,15 @@ fn test_output_delimiter_with_adjacent_ranges() {
.succeeds()
.stdout_only("ab:cd\n");
}
#[cfg(target_os = "linux")]
#[test]
fn test_failed_write_is_reported() {
new_ucmd!()
.arg("-d=")
.arg("-f1")
.pipe_in("key=value")
.set_stdout(std::fs::File::create("/dev/full").unwrap())
.fails()
.stderr_is("cut: write error: No space left on device\n");
}