[libcxx-commits] [PATCH] D98640: [libcxx] [test] Fix windows errors in fs.op.rename

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 16 04:31:17 PDT 2021


mstorsjo updated this revision to Diff 330936.
mstorsjo added a comment.

Expanded the comment with spec references, added a requested trailing comma.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98640/new/

https://reviews.llvm.org/D98640

Files:
  libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.rename/rename.pass.cpp


Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.rename/rename.pass.cpp
===================================================================
--- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.rename/rename.pass.cpp
+++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.rename/rename.pass.cpp
@@ -62,7 +62,13 @@
     } cases[] = {
         {dne, dne},
         {file, dir},
-        {dir, file}
+#ifndef _WIN32
+        // The spec doesn't say that this case must be an error; fs.op.rename
+        // note 1.2.1 says that a file may be overwritten by a rename.
+        // On Windows, with rename() implemented with MoveFileExW, overwriting
+        // a file with a directory is not an error.
+        {dir, file},
+#endif
     };
     for (auto& TC : cases) {
         auto from_before = status(TC.from);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98640.330936.patch
Type: text/x-patch
Size: 844 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210316/83922612/attachment.bin>


More information about the libcxx-commits mailing list