Test Child::kill behaviour on exited process

This commit is contained in:
Chris Denton 2023-07-01 01:34:06 +01:00
parent e7fda447e7
commit 4309954187
No known key found for this signature in database
GPG Key ID: 713472F2F45627DE

View File

@ -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());
}