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

tty: correct exit code for write errrors

This commit is contained in:
Michael Debertol 2021-06-16 17:38:07 +02:00
parent aeaf2cebfb
commit 4c5ee1dbd7
2 changed files with 20 additions and 3 deletions

View file

@ -63,3 +63,12 @@ fn test_close_stdin_silent_alias() {
fn test_wrong_argument() {
new_ucmd!().args(&["a"]).fails().code_is(2);
}
#[test]
#[cfg(not(windows))]
fn test_stdout_fail() {
let mut child = new_ucmd!().run_no_wait();
drop(child.stdout.take());
let status = child.wait().unwrap();
assert_eq!(status.code(), Some(3));
}