Fix process-spawn-nonexistent on WSL
If appendWindowsPath is set to true (the default IIRC), running invalid commands returns PermissionDenied instead of NotFound.
This commit is contained in:
parent
ff693dc7b8
commit
29cfefd355
1 changed files with 7 additions and 5 deletions
|
@ -6,9 +6,11 @@ use std::io::ErrorKind;
|
||||||
use std::process::Command;
|
use std::process::Command;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
assert_eq!(Command::new("nonexistent")
|
let result = Command::new("nonexistent").spawn().unwrap_err().kind();
|
||||||
.spawn()
|
|
||||||
.unwrap_err()
|
assert!(matches!(
|
||||||
.kind(),
|
result,
|
||||||
ErrorKind::NotFound);
|
// Under WSL with appendWindowsPath=true, this fails with PermissionDenied
|
||||||
|
ErrorKind::NotFound | ErrorKind::PermissionDenied
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue