about summary refs log tree commit diff
path: root/library/std/src/sys/windows/path
diff options
context:
space:
mode:
authorChris Denton <christophersdenton@gmail.com>2021-10-23 19:34:09 +0100
committerChris Denton <christophersdenton@gmail.com>2021-10-23 19:35:24 +0100
commitf1efc7efb2bc39021eb93228b1e25c384767b38d (patch)
treed55a1d283fcd28efd5358b1566b8b16a4309eb30 /library/std/src/sys/windows/path
parent3e2d60624162845238fa3b2fbb874eee51daa983 (diff)
downloadrust-f1efc7efb2bc39021eb93228b1e25c384767b38d.tar.gz
rust-f1efc7efb2bc39021eb93228b1e25c384767b38d.zip
Make sure `CreateDirectoryW` works for path lengths > 247
Diffstat (limited to 'library/std/src/sys/windows/path')
-rw-r--r--library/std/src/sys/windows/path/tests.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/library/std/src/sys/windows/path/tests.rs b/library/std/src/sys/windows/path/tests.rs
index 131d27a99fe..c6c84519f41 100644
--- a/library/std/src/sys/windows/path/tests.rs
+++ b/library/std/src/sys/windows/path/tests.rs
@@ -81,6 +81,13 @@ fn verbatim() {
     check(r"\\server\share", r"\\server\share");
     check(r"\\.\COM1", r"\\.\COM1");
 
+    // Check that paths of length 247 are converted to verbatim.
+    // This is necessary for `CreateDirectory`.
+    check(
+        r"C:\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+        r"\\?\C:\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
+    );
+
     // Make sure opening a drive will work.
     check("Z:", "Z:");