Compare commits

...

2 Commits

Author SHA1 Message Date
John Nunley 581c0a02c0 v2.2.0
Signed-off-by: John Nunley <dev@notgull.net>
2024-03-30 09:12:08 -07:00
John Nunley 420c303921
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>
2024-03-30 08:31:01 -07:00
3 changed files with 31 additions and 1 deletions

View File

@ -1,3 +1,7 @@
# Version 2.2.0
- Port Linux to a new backend that tries to use `pidfd` if it is available. (#68)
# Version 2.1.0
- Update `event-listener` to v5.1.0. (#67)

View File

@ -3,7 +3,7 @@ name = "async-process"
# When publishing a new version:
# - Update CHANGELOG.md
# - Create "v2.x.y" git tag
version = "2.1.0"
version = "2.2.0"
authors = ["Stjepan Glavina <stjepang@gmail.com>"]
edition = "2021"
rust-version = "1.63"

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