Files
tokio/tokio-process/tests/smoke.rs
T
Ivan Petkov cb2336ff3d process: Misc polish (#1400)
* Denied all warnings in tests, and denied rust_2018_idioms violations
* Bumped the crate version and set publish = false
* Pruned dependencies:
 - Only pull in tokio-sync on windows where it is used
 - Removed unused dev-dependencies
* Switch to Async{Read, Write} traits from tokio-io rather than
futures-io
* Use #[tokio::test] where possible
* Removed deprecated items
* Fix all doc examples
2019-08-07 10:38:45 -07:00

26 lines
505 B
Rust

#![deny(warnings, rust_2018_idioms)]
#![feature(async_await)]
use tokio_process::CommandExt;
mod support;
#[tokio::test]
async 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 = support::with_timeout(&mut child)
.await
.expect("failed to run future");
assert_eq!(status.code(), Some(2));
assert_eq!(child.id(), id);
drop(child.kill());
}