#[cfg(unix)]
pub use std::os::unix::process::ExitStatusExt;
#[cfg(not(unix))]
compile_error!(
"Only Unix-like systems (Linux, macOS) are supported. Windows support has been removed."
);
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_from_raw_success() {
let status = std::process::ExitStatus::from_raw(0);
assert!(status.success());
#[cfg(unix)]
{
assert!(status.success());
}
#[cfg(not(unix))]
{
assert_eq!(status.code(), Some(0));
}
}
#[test]
fn test_from_raw_failure() {
let status = std::process::ExitStatus::from_raw(256); assert!(!status.success());
#[cfg(unix)]
{
assert!(!status.success());
}
#[cfg(not(unix))]
{
assert_eq!(status.code(), Some(1));
}
}
}