mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
timeout: return 125 on invalid time interval args
Exit with status 125 (indicating an error in `timeout` itself) when the timeout duration is invalid or the "kill after" duration is invalid.
This commit is contained in:
parent
9a0ef9a81f
commit
b34685f8a5
2 changed files with 18 additions and 4 deletions
|
@ -16,6 +16,16 @@ fn test_invalid_time_interval() {
|
|||
new_ucmd!()
|
||||
.args(&["xyz", "sleep", "0"])
|
||||
.fails()
|
||||
.code_is(125)
|
||||
.usage_error("invalid time interval 'xyz'");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_invalid_kill_after() {
|
||||
new_ucmd!()
|
||||
.args(&["-k", "xyz", "1", "sleep", "0"])
|
||||
.fails()
|
||||
.code_is(125)
|
||||
.usage_error("invalid time interval 'xyz'");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue