[libcxx-commits] [PATCH] D98108: [libcxx] [test] Fix path.modifiers remove_filename and replace_filename for windows

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Mar 5 23:55:05 PST 2021


mstorsjo created this revision.
mstorsjo requested review of this revision.
Herald added a project: libc++.
Herald added a reviewer: libc++.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D98108

Files:
  libcxx/test/std/input.output/filesystems/class.path/path.member/path.modifiers/remove_filename.pass.cpp
  libcxx/test/std/input.output/filesystems/class.path/path.member/path.modifiers/replace_filename.pass.cpp


Index: libcxx/test/std/input.output/filesystems/class.path/path.member/path.modifiers/replace_filename.pass.cpp
===================================================================
--- libcxx/test/std/input.output/filesystems/class.path/path.member/path.modifiers/replace_filename.pass.cpp
+++ libcxx/test/std/input.output/filesystems/class.path/path.member/path.modifiers/replace_filename.pass.cpp
@@ -35,10 +35,22 @@
     , {"/foo", "/", ""}
     , {"foo", "bar", "bar"}
     , {"/", "/bar", "bar"}
+#ifdef _WIN32
+    , {"\\", "\\bar", "bar"}
+#else
     , {"\\", "bar", "bar"}
+#endif
     , {"///", "///bar", "bar"}
+#ifdef _WIN32
+    , {"\\\\", "\\\\bar", "bar"}
+#else
     , {"\\\\", "bar", "bar"}
+#endif
+#ifdef _WIN32
+    , {"\\/\\", "\\/\\bar", "bar"}
+#else
     , {"\\/\\", "\\/bar", "bar"}
+#endif
     , {".", "bar", "bar"}
     , {"..", "bar", "bar"}
     , {"/foo\\baz/bong/", "/foo\\baz/bong/bar", "bar"}
Index: libcxx/test/std/input.output/filesystems/class.path/path.member/path.modifiers/remove_filename.pass.cpp
===================================================================
--- libcxx/test/std/input.output/filesystems/class.path/path.member/path.modifiers/remove_filename.pass.cpp
+++ libcxx/test/std/input.output/filesystems/class.path/path.member/path.modifiers/remove_filename.pass.cpp
@@ -34,13 +34,21 @@
     , {"/", "/"}
     , {"//", "//"}
     , {"///", "///"}
+#ifdef _WIN32
+    , {"\\", "\\"}
+#else
     , {"\\", ""}
+#endif
     , {".", ""}
     , {"..", ""}
     , {"/foo", "/"}
     , {"foo/bar", "foo/"}
     , {"foo/", "foo/"}
+#ifdef _WIN32
+    , {"//foo", "//foo"}
+#else
     , {"//foo", "//"}
+#endif
     , {"//foo/", "//foo/"}
     , {"//foo///", "//foo///"}
     , {"///foo", "///"}
@@ -49,7 +57,11 @@
     , {"/foo/.", "/foo/"}
     , {"/foo/..", "/foo/"}
     , {"/foo/////", "/foo/////"}
+#ifdef _WIN32
+    , {"/foo\\\\", "/foo\\\\"}
+#else
     , {"/foo\\\\", "/"}
+#endif
     , {"/foo//\\/", "/foo//\\/"}
     , {"///foo", "///"}
     , {"file.txt", ""}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98108.328745.patch
Type: text/x-patch
Size: 2017 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210306/3a422189/attachment-0001.bin>


More information about the libcxx-commits mailing list