Skip to content

Commit 4309954

Browse files
committed
Test Child::kill behaviour on exited process
1 parent e7fda44 commit 4309954

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

library/std/src/process/tests.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,3 +582,11 @@ fn run_canonical_bat_script() {
582582
assert!(output.status.success());
583583
assert_eq!(String::from_utf8_lossy(&output.stdout).trim(), "Hello, fellow Rustaceans!");
584584
}
585+
586+
#[test]
587+
fn terminate_exited_process() {
588+
let mut p = known_command().arg("hello").spawn().unwrap();
589+
p.wait().unwrap();
590+
assert!(p.kill().is_ok());
591+
assert!(p.kill().is_ok());
592+
}

0 commit comments

Comments
 (0)