diff options
author | Ondřej Čertík <ondrej@certik.us> | 2020-01-15 23:07:59 -0700 |
---|---|---|
committer | Ondřej Čertík <ondrej@certik.us> | 2020-01-15 23:07:59 -0700 |
commit | 1f7bf6c0335a6979e11a62fc07cd8cb7c1c04464 (patch) | |
tree | dbd41d685ecefe50f48573c83d2789503300fa10 /tests/cli.rs | |
parent | c6e207e15b0dcc381c72ed5d94972b3d4f2b1b18 (diff) | |
download | fpm-1f7bf6c0335a6979e11a62fc07cd8cb7c1c04464.tar.gz fpm-1f7bf6c0335a6979e11a62fc07cd8cb7c1c04464.zip |
Only import std::os::unix on Unix
Diffstat (limited to 'tests/cli.rs')
-rw-r--r-- | tests/cli.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/cli.rs b/tests/cli.rs index fb73e8a..40fabbd 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -2,6 +2,7 @@ use std::process::Command; // Run programs use assert_cmd::prelude::*; // Add methods on commands use predicates::prelude::*; // Used for writing assertions use assert_cmd::assert::Assert; +#[cfg(unix)] use std::os::unix::process::ExitStatusExt; pub trait Success2 { @@ -13,9 +14,11 @@ impl Success2 for Assert { fn success2(self) -> Self { if !self.get_output().status.success() { let code = self.get_output().status.code(); - if code.is_none() { - let signal = self.get_output().status.signal().unwrap(); - panic!("INTERRUPTED with signal: {}", signal); + if cfg!(unix) { + if code.is_none() { + let signal = self.get_output().status.signal().unwrap(); + panic!("INTERRUPTED with signal: {}", signal); + } } let actual_code = code.unwrap(); panic!("Non zero exit code: {}", actual_code); |