mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
kill: use only least significant bits to identify signal with -l (#7225)
* kill: check the lower 5 bits when the input is a number * test/kill: added testcase * kill: check the last 7 bits * kill: check only the last 8 bits and the signals in the range [128, 159] --------- Co-authored-by: Sylvestre Ledru <sylvestre@debian.org>
This commit is contained in:
parent
5e81358c4a
commit
1595b6afaa
3 changed files with 50 additions and 2 deletions
|
@ -334,6 +334,39 @@ fn test_kill_with_signal_and_list() {
|
|||
.fails();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_kill_with_list_lower_bits() {
|
||||
new_ucmd!()
|
||||
.arg("-l")
|
||||
.arg("128")
|
||||
.succeeds()
|
||||
.stdout_contains("EXIT");
|
||||
|
||||
new_ucmd!()
|
||||
.arg("-l")
|
||||
.arg("143")
|
||||
.succeeds()
|
||||
.stdout_contains("TERM");
|
||||
|
||||
new_ucmd!()
|
||||
.arg("-l")
|
||||
.arg("256")
|
||||
.succeeds()
|
||||
.stdout_contains("EXIT");
|
||||
|
||||
new_ucmd!()
|
||||
.arg("-l")
|
||||
.arg("2304")
|
||||
.succeeds()
|
||||
.stdout_contains("EXIT");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_kill_with_list_lower_bits_unrecognized() {
|
||||
new_ucmd!().arg("-l").arg("111").fails();
|
||||
new_ucmd!().arg("-l").arg("384").fails();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_kill_with_signal_and_table() {
|
||||
let target = Target::new();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue