ci: Add a test that sleeps

I think this catches errors in notification for the Linux backend.

Signed-off-by: John Nunley <dev@notgull.net>
This commit is contained in:
John Nunley 2024-03-30 08:31:01 -07:00 committed by GitHub
parent bbd42b56f8
commit 420c303921
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 26 additions and 0 deletions

26
tests/sleep.rs Normal file
View File

@ -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());
});
}