rust/tests/ui/process/process-spawn-nonexistent.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
445 B
Rust
Raw Normal View History

// run-pass
// ignore-emscripten no processes
2019-04-24 11:26:33 -05:00
// ignore-sgx no processes
// ignore-fuchsia ErrorKind not translated
use std::io::ErrorKind;
use std::process::Command;
fn main() {
let result = Command::new("nonexistent").spawn().unwrap_err().kind();
assert!(matches!(
result,
// Under WSL with appendWindowsPath=true, this fails with PermissionDenied
ErrorKind::NotFound | ErrorKind::PermissionDenied
));
}