Skip to content

Commit

Permalink
Test Child::kill behaviour on exited process
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisDenton committed Jul 4, 2023
1 parent e7fda44 commit 4309954
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions library/std/src/process/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,3 +582,11 @@ fn run_canonical_bat_script() {
assert!(output.status.success());
assert_eq!(String::from_utf8_lossy(&output.stdout).trim(), "Hello, fellow Rustaceans!");
}

#[test]
fn terminate_exited_process() {
let mut p = known_command().arg("hello").spawn().unwrap();
p.wait().unwrap();
assert!(p.kill().is_ok());
assert!(p.kill().is_ok());
}

0 comments on commit 4309954

Please sign in to comment.