about summary refs log tree commit diff
path: root/library/std/src/sys/windows/process/tests.rs
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-03-19 02:01:59 +0100
committerGitHub <noreply@github.com>2022-03-19 02:01:59 +0100
commitba2d5ede70ed7e37d7f13a397b9d554e2386a19c (patch)
tree078ea0f9241c1afbace170ba8ebc25f4bb4028ee /library/std/src/sys/windows/process/tests.rs
parent9b701e7eaa08c2b2ef8c6e59b8b33436cb10aa45 (diff)
parent93f627daa53677f76ad50bcfa3c8eb618f5ca89f (diff)
downloadrust-ba2d5ede70ed7e37d7f13a397b9d554e2386a19c.tar.gz
rust-ba2d5ede70ed7e37d7f13a397b9d554e2386a19c.zip
Rollup merge of #92519 - ChrisDenton:command-maybe-verbatim, r=dtolnay
Use verbatim paths for `process::Command` if necessary

In #89174, the standard library started using verbatim paths so longer paths are usable by default. However, `Command` was originally left out because of the way `CreateProcessW` was being called. This was changed as a side effect of #87704 so now `Command` paths can be converted to verbatim too (if necessary).
Diffstat (limited to 'library/std/src/sys/windows/process/tests.rs')
-rw-r--r--library/std/src/sys/windows/process/tests.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/library/std/src/sys/windows/process/tests.rs b/library/std/src/sys/windows/process/tests.rs
index d8c9beb0c19..96477fb19da 100644
--- a/library/std/src/sys/windows/process/tests.rs
+++ b/library/std/src/sys/windows/process/tests.rs
@@ -3,11 +3,12 @@ use super::Arg;
 use crate::env;
 use crate::ffi::{OsStr, OsString};
 use crate::process::Command;
+use crate::sys::to_u16s;
 
 #[test]
 fn test_raw_args() {
     let command_line = &make_command_line(
-        OsStr::new("quoted exe"),
+        &to_u16s("quoted exe").unwrap(),
         &[
             Arg::Regular(OsString::from("quote me")),
             Arg::Raw(OsString::from("quote me *not*")),
@@ -16,6 +17,7 @@ fn test_raw_args() {
             Arg::Regular(OsString::from("optional-quotes")),
         ],
         false,
+        false,
     )
     .unwrap();
     assert_eq!(
@@ -28,9 +30,10 @@ fn test_raw_args() {
 fn test_make_command_line() {
     fn test_wrapper(prog: &str, args: &[&str], force_quotes: bool) -> String {
         let command_line = &make_command_line(
-            OsStr::new(prog),
+            &to_u16s(prog).unwrap(),
             &args.iter().map(|a| Arg::Regular(OsString::from(a))).collect::<Vec<_>>(),
             force_quotes,
+            false,
         )
         .unwrap();
         String::from_utf16(command_line).unwrap()