Skip to content

Commit

Permalink
ci: Add a test that sleeps
Browse files Browse the repository at this point in the history
I think this catches errors in notification for the Linux backend.

Signed-off-by: John Nunley <[email protected]>
  • Loading branch information
notgull authored Mar 30, 2024
1 parent bbd42b5 commit 420c303
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions tests/sleep.rs
Original file line number Diff line number Diff line change
@@ -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());
});
}

0 comments on commit 420c303

Please sign in to comment.