diff options
Diffstat (limited to 'tokio/tests/process_smoke.rs')
-rw-r--r-- | tokio/tests/process_smoke.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tokio/tests/process_smoke.rs b/tokio/tests/process_smoke.rs index d16d1d72..fae5793f 100644 --- a/tokio/tests/process_smoke.rs +++ b/tokio/tests/process_smoke.rs @@ -18,12 +18,17 @@ async fn simple() { let mut child = cmd.arg("exit 2").spawn().unwrap(); - let id = child.id(); + let id = child.id().expect("missing id"); assert!(id > 0); - let status = assert_ok!((&mut child).await); + let status = assert_ok!(child.wait().await); assert_eq!(status.code(), Some(2)); - assert_eq!(child.id(), id); + // test that the `.wait()` method is fused just like the stdlib + let status = assert_ok!(child.wait().await); + assert_eq!(status.code(), Some(2)); + + // Can't get id after process has exited + assert_eq!(child.id(), None); drop(child.kill()); } |