mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
kill: don't allow lowercase signal names with '-'
This commit is contained in:
parent
943b44627b
commit
2668c98d9d
2 changed files with 20 additions and 4 deletions
|
@ -198,12 +198,24 @@ fn test_kill_with_signal_number_old_form() {
|
|||
|
||||
#[test]
|
||||
fn test_kill_with_signal_name_old_form() {
|
||||
let mut target = Target::new();
|
||||
for arg in ["-Kill", "-KILL"] {
|
||||
let mut target = Target::new();
|
||||
new_ucmd!()
|
||||
.arg(arg)
|
||||
.arg(format!("{}", target.pid()))
|
||||
.succeeds();
|
||||
assert_eq!(target.wait_for_signal(), Some(libc::SIGKILL));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_kill_with_lower_case_signal_name_old_form() {
|
||||
let target = Target::new();
|
||||
new_ucmd!()
|
||||
.arg("-KILL")
|
||||
.arg("-kill")
|
||||
.arg(format!("{}", target.pid()))
|
||||
.succeeds();
|
||||
assert_eq!(target.wait_for_signal(), Some(libc::SIGKILL));
|
||||
.fails()
|
||||
.stderr_contains("unexpected argument");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue