mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-15 00:00:15 +02:00
24 lines
460 B
Rust
24 lines
460 B
Rust
extern crate tokio_current_thread;
|
|
extern crate tokio_process;
|
|
|
|
use tokio_process::CommandExt;
|
|
|
|
mod support;
|
|
|
|
#[test]
|
|
fn simple() {
|
|
let mut cmd = support::cmd("exit");
|
|
cmd.arg("2");
|
|
|
|
let mut child = cmd.spawn_async().unwrap();
|
|
|
|
let id = child.id();
|
|
assert!(id > 0);
|
|
|
|
let status = tokio_current_thread::block_on_all(&mut child).unwrap();
|
|
assert_eq!(status.code(), Some(2));
|
|
|
|
assert_eq!(child.id(), id);
|
|
drop(child.kill());
|
|
}
|