rust/tests/ui/process/process-spawn-nonexistent.rs
2025-01-23 20:51:29 +08:00

17 lines
407 B
Rust

//@ run-pass
//@ needs-subprocess
//@ 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
));
}