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

ptx: Flush BufWriter, add context to errors

This commit is contained in:
Jan Verbeek 2025-03-31 13:01:43 +02:00
parent cba48c0284
commit bfdde70309
2 changed files with 17 additions and 2 deletions

View file

@ -163,3 +163,14 @@ fn test_format() {
.succeeds()
.stdout_only("\\xx {}{}{a}{}{}\n");
}
#[cfg(target_os = "linux")]
#[test]
fn test_failed_write_is_reported() {
new_ucmd!()
.arg("-G")
.pipe_in("hello")
.set_stdout(std::fs::File::create("/dev/full").unwrap())
.fails()
.stderr_is("ptx: write failed: No space left on device\n");
}