summaryrefslogtreecommitdiffstats
path: root/tests/ui/process/process-spawn-nonexistent.rs
blob: 9dd608986df169be7094cfb639eb15ec36512995 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// run-pass
// ignore-emscripten no processes
// 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
    ));
}