diff --git a/tests/sleep.rs b/tests/sleep.rs new file mode 100644 index 0000000..44eea4e --- /dev/null +++ b/tests/sleep.rs @@ -0,0 +1,26 @@ +//! Sleep test. + +use async_process::Command; +use futures_lite::future::block_on; + +#[cfg(unix)] +#[test] +fn unix_sleep() { + block_on(async { + let status = Command::new("sleep").arg("1").status().await.unwrap(); + assert!(status.success()); + }); +} + +#[cfg(windows)] +#[test] +fn windows_sleep() { + block_on(async { + let status = Command::new("ping") + .args(["-n", "5", "127.0.0.1"]) + .status() + .await + .unwrap(); + assert!(status.success()); + }); +}