diff options
| author | Chris Denton <chris@chrisdenton.dev> | 2023-07-01 01:34:06 +0100 |
|---|---|---|
| committer | Chris Denton <chris@chrisdenton.dev> | 2023-07-04 09:50:49 +0100 |
| commit | 4309954187657bddc8daba59187a463d612cf3f9 (patch) | |
| tree | 4ad7f009cea6eca046b2e858efbef042f8489ac3 /library/std/src/process/tests.rs | |
| parent | e7fda447e7d05b6ca431fc8fe8f489b1fda810bc (diff) | |
| download | rust-4309954187657bddc8daba59187a463d612cf3f9.tar.gz rust-4309954187657bddc8daba59187a463d612cf3f9.zip | |
Test Child::kill behaviour on exited process
Diffstat (limited to 'library/std/src/process/tests.rs')
| -rw-r--r-- | library/std/src/process/tests.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/library/std/src/process/tests.rs b/library/std/src/process/tests.rs index d7f4d335de3..e2c56e634d9 100644 --- a/library/std/src/process/tests.rs +++ b/library/std/src/process/tests.rs @@ -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()); +} |
