Skip to content

Commit 04c0cf4

Browse files
committed
Add tests for completed children
1 parent 9acc194 commit 04c0cf4

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

‎src/stdlib.rs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,13 @@ mod tests {
6060
child.interrupt().unwrap();
6161
child.wait().unwrap();
6262
}
63+
64+
#[test]
65+
fn test_completed_interruptible_command() {
66+
let mut command = std::process::Command::new("ping");
67+
68+
let mut child = command.spawn_interruptible().unwrap();
69+
child.wait().unwrap();
70+
assert!(child.interrupt().is_err());
71+
}
6372
}

‎src/tokio.rs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,13 @@ mod tests {
6060
child.interrupt().unwrap();
6161
child.wait().await.unwrap();
6262
}
63+
64+
#[tokio::test]
65+
async fn test_completed_interruptible_command() {
66+
let mut command = tokio::process::Command::new("ping");
67+
68+
let mut child = command.spawn_interruptible().unwrap();
69+
child.wait().await.unwrap();
70+
assert!(child.interrupt().is_err());
71+
}
6372
}

0 commit comments

Comments
 (0)