about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2022-07-27 13:58:29 +0200
committerNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2022-07-27 14:15:44 +0200
commit29cfefd35588535295d6d1f63b51e8a7cca0e738 (patch)
tree132154afdaa16611c6994465aea75acd0890d007
parentff693dc7b8119a1761edf0d08156bb670708824a (diff)
downloadrust-29cfefd35588535295d6d1f63b51e8a7cca0e738.tar.gz
rust-29cfefd35588535295d6d1f63b51e8a7cca0e738.zip
Fix process-spawn-nonexistent on WSL
If appendWindowsPath is set to true (the default IIRC), running invalid
commands returns PermissionDenied instead of NotFound.
-rw-r--r--src/test/ui/process/process-spawn-nonexistent.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/test/ui/process/process-spawn-nonexistent.rs b/src/test/ui/process/process-spawn-nonexistent.rs
index 70de7316a81..a513722639a 100644
--- a/src/test/ui/process/process-spawn-nonexistent.rs
+++ b/src/test/ui/process/process-spawn-nonexistent.rs
@@ -6,9 +6,11 @@ use std::io::ErrorKind;
 use std::process::Command;
 
 fn main() {
-    assert_eq!(Command::new("nonexistent")
-                   .spawn()
-                   .unwrap_err()
-                   .kind(),
-               ErrorKind::NotFound);
+    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
+    ));
 }