mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-22 00:00:11 +02:00
* 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
26 lines
505 B
Rust
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());
|
|
}
|