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

timeout: disable timeout if it is set to zero

This commit is contained in:
Michael Debertol 2021-06-10 18:51:41 +02:00
parent 8e0ed2d20e
commit 0f9bc8e974
3 changed files with 20 additions and 4 deletions

View file

@ -31,3 +31,17 @@ fn test_verbose() {
.stderr_only("timeout: sending signal EXIT to command 'sleep'\ntimeout: sending signal KILL to command 'sleep'");
}
}
#[test]
fn test_zero_timeout() {
new_ucmd!()
.args(&["-v", "0", "sleep", ".1"])
.succeeds()
.no_stderr()
.no_stdout();
new_ucmd!()
.args(&["-v", "0", "-s0", "-k0", "sleep", ".1"])
.succeeds()
.no_stderr()
.no_stdout();
}