Skip to content

Commit c4c8129

Browse files
m-haishamBenWiederhake
authored andcommitted
kill: add tests to check multiple output
1 parent 693149d commit c4c8129

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/by-util/test_kill.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,28 @@ fn test_kill_list_one_signal_from_name() {
9292
.stdout_matches(&Regex::new("\\b9\\b").unwrap());
9393
}
9494

95+
#[test]
96+
fn test_kill_list_two_signal_from_name() {
97+
new_ucmd!()
98+
.arg("-l")
99+
.arg("INT")
100+
.arg("KILL")
101+
.succeeds()
102+
.stdout_matches(&Regex::new("\\d\n\\d").unwrap());
103+
}
104+
105+
#[test]
106+
fn test_kill_list_three_signal_first_unknown() {
107+
new_ucmd!()
108+
.arg("-l")
109+
.arg("IAMNOTASIGNAL") // spell-checker:disable-line
110+
.arg("INT")
111+
.arg("KILL")
112+
.fails()
113+
.stderr_contains("unknown signal")
114+
.stdout_matches(&Regex::new("\\d\n\\d").unwrap());
115+
}
116+
95117
#[test]
96118
fn test_kill_set_bad_signal_name() {
97119
// spell-checker:disable-line

0 commit comments

Comments
 (0)