We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aa8f0fd commit 850ddbfCopy full SHA for 850ddbf
tests/ui/process/win-command-curdir-no-verbatim.rs
@@ -0,0 +1,35 @@
1
+// Test that windows `creation_flags` extension to `Command` works.
2
+
3
+//@ run-pass
4
+//@ only-windows
5
+//@ needs-subprocess
6
7
+use std::process::Command;
8
+use std::{env, fs};
9
10
+fn main() {
11
+ if env::args().skip(1).any(|s| s == "--child") {
12
+ child();
13
+ } else {
14
+ parent();
15
+ }
16
+}
17
18
+fn parent() {
19
+ let exe = env::current_exe().unwrap();
20
+ let dir = env::current_dir().unwrap();
21
+ let status = Command::new(&exe)
22
+ .arg("--child")
23
+ .current_dir(fs::canonicalize(dir).unwrap())
24
+ .spawn()
25
+ .unwrap()
26
+ .wait()
27
+ .unwrap();
28
+ assert_eq!(status.code(), Some(0));
29
30
31
+fn child() {
32
+ let current_dir = env::current_dir().unwrap();
33
+ let current_dir = current_dir.as_os_str().as_encoded_bytes();
34
+ assert!(!current_dir.starts_with(br"\\?\"));
35
0 commit comments