about summary refs log tree commit diff
path: root/library/std/src/sys
diff options
context:
space:
mode:
authorKornel <kornel@geekhood.net>2021-07-04 18:33:15 +0100
committerKornel <kornel@cloudflare.com>2021-07-09 14:09:48 +0100
commitfcd5cecdcf50865df7838d734dfa5aeaa1f9c81e (patch)
tree4595c2d6146c73e22efa1097580e52a9570be1aa /library/std/src/sys
parentee86f96ba176f598d64dc9f3bb7e074d5b8b86b6 (diff)
downloadrust-fcd5cecdcf50865df7838d734dfa5aeaa1f9c81e.tar.gz
rust-fcd5cecdcf50865df7838d734dfa5aeaa1f9c81e.zip
Test escaping of trialing slashes in Windows command-line args
Diffstat (limited to 'library/std/src/sys')
-rw-r--r--library/std/src/sys/windows/process/tests.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/library/std/src/sys/windows/process/tests.rs b/library/std/src/sys/windows/process/tests.rs
index ff3f9131cc8..331bc9db3b1 100644
--- a/library/std/src/sys/windows/process/tests.rs
+++ b/library/std/src/sys/windows/process/tests.rs
@@ -17,6 +17,11 @@ fn test_make_command_line() {
 
     assert_eq!(test_wrapper("prog", &["aaa", "bbb", "ccc"], false), "\"prog\" aaa bbb ccc");
 
+    assert_eq!(test_wrapper("prog", &[r"C:\"], false), r#""prog" C:\"#);
+    assert_eq!(test_wrapper("prog", &[r"2slashes\\"], false), r#""prog" 2slashes\\"#);
+    assert_eq!(test_wrapper("prog", &[r" C:\"], false), r#""prog" " C:\\""#);
+    assert_eq!(test_wrapper("prog", &[r" 2slashes\\"], false), r#""prog" " 2slashes\\\\""#);
+
     assert_eq!(
         test_wrapper("C:\\Program Files\\blah\\blah.exe", &["aaa"], false),
         "\"C:\\Program Files\\blah\\blah.exe\" aaa"