Skip to content

Commit dd6998c

Browse files
committed
tests/kill: Test supplying invalid UTF-8 argument to kill
1 parent d444988 commit dd6998c

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎tests/by-util/test_kill.rs‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,3 +539,15 @@ fn test_kill_realtime_signal() {
539539
.succeeds();
540540
assert_eq!(target.wait_for_signal(), Some(libc::SIGRTMIN()));
541541
}
542+
543+
#[test]
544+
fn test_kill_invalid_utf8() {
545+
let arg = uucore::os_str_from_bytes(b"\xFFa\xFF")
546+
.expect("Only unix platforms can test non-unicode names");
547+
548+
new_ucmd!()
549+
.arg("-l")
550+
.arg(&arg)
551+
.fails()
552+
.stderr_contains("'\u{FFFD}a\u{FFFD}': invalid signal");
553+
}

0 commit comments

Comments
 (0)