mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
tests/kill: test old form args with signal name
Add two tests of the old form signal arg using the signal name instead of the number. Bonus: add a test for the new form but with the prefix SIG-
This commit is contained in:
parent
92a1f1422e
commit
872c0fac1d
1 changed files with 31 additions and 0 deletions
|
@ -104,6 +104,26 @@ fn test_kill_with_signal_number_old_form() {
|
||||||
assert_eq!(target.wait_for_signal(), Some(9));
|
assert_eq!(target.wait_for_signal(), Some(9));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_kill_with_signal_name_old_form() {
|
||||||
|
let mut target = Target::new();
|
||||||
|
new_ucmd!()
|
||||||
|
.arg("-KILL")
|
||||||
|
.arg(format!("{}", target.pid()))
|
||||||
|
.succeeds();
|
||||||
|
assert_eq!(target.wait_for_signal(), Some(libc::SIGKILL));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_kill_with_signal_prefixed_name_old_form() {
|
||||||
|
let mut target = Target::new();
|
||||||
|
new_ucmd!()
|
||||||
|
.arg("-SIGKILL")
|
||||||
|
.arg(format!("{}", target.pid()))
|
||||||
|
.succeeds();
|
||||||
|
assert_eq!(target.wait_for_signal(), Some(libc::SIGKILL));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_kill_with_signal_number_new_form() {
|
fn test_kill_with_signal_number_new_form() {
|
||||||
let mut target = Target::new();
|
let mut target = Target::new();
|
||||||
|
@ -125,3 +145,14 @@ fn test_kill_with_signal_name_new_form() {
|
||||||
.succeeds();
|
.succeeds();
|
||||||
assert_eq!(target.wait_for_signal(), Some(libc::SIGKILL));
|
assert_eq!(target.wait_for_signal(), Some(libc::SIGKILL));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_kill_with_signal_prefixed_name_new_form() {
|
||||||
|
let mut target = Target::new();
|
||||||
|
new_ucmd!()
|
||||||
|
.arg("-s")
|
||||||
|
.arg("SIGKILL")
|
||||||
|
.arg(format!("{}", target.pid()))
|
||||||
|
.succeeds();
|
||||||
|
assert_eq!(target.wait_for_signal(), Some(libc::SIGKILL));
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue