Skip to content

Commit fcd5cec

Browse files
committed
Test escaping of trialing slashes in Windows command-line args
1 parent ee86f96 commit fcd5cec

File tree

1 file changed

+5
-0
lines changed
  • library/std/src/sys/windows/process

1 file changed

+5
-0
lines changed

library/std/src/sys/windows/process/tests.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ fn test_make_command_line() {
1717

1818
assert_eq!(test_wrapper("prog", &["aaa", "bbb", "ccc"], false), "\"prog\" aaa bbb ccc");
1919

20+
assert_eq!(test_wrapper("prog", &[r"C:\"], false), r#""prog" C:\"#);
21+
assert_eq!(test_wrapper("prog", &[r"2slashes\\"], false), r#""prog" 2slashes\\"#);
22+
assert_eq!(test_wrapper("prog", &[r" C:\"], false), r#""prog" " C:\\""#);
23+
assert_eq!(test_wrapper("prog", &[r" 2slashes\\"], false), r#""prog" " 2slashes\\\\""#);
24+
2025
assert_eq!(
2126
test_wrapper("C:\\Program Files\\blah\\blah.exe", &["aaa"], false),
2227
"\"C:\\Program Files\\blah\\blah.exe\" aaa"

0 commit comments

Comments
 (0)