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

timeout: add support for -f and -p short options

This commit is contained in:
Daniel Hofstetter 2025-01-23 16:05:14 +01:00
parent 5b056704da
commit df91808649
2 changed files with 22 additions and 7 deletions

View file

@ -82,15 +82,28 @@ fn test_command_empty_args() {
.stderr_contains("timeout: empty string");
}
#[test]
fn test_foreground() {
for arg in ["-f", "--foreground"] {
new_ucmd!()
.args(&[arg, ".1", "sleep", "10"])
.fails()
.code_is(124)
.no_output();
}
}
#[test]
fn test_preserve_status() {
new_ucmd!()
.args(&["--preserve-status", ".1", "sleep", "10"])
.fails()
// 128 + SIGTERM = 128 + 15
.code_is(128 + 15)
.no_stderr()
.no_stdout();
for arg in ["-p", "--preserve-status"] {
new_ucmd!()
.args(&[arg, ".1", "sleep", "10"])
.fails()
// 128 + SIGTERM = 128 + 15
.code_is(128 + 15)
.no_stderr()
.no_stdout();
}
}
#[test]