[libcxx-commits] [PATCH] D89944: [libcxx] [test] Fix the fs.op.absolute test to cope with windows paths

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 22 03:36:36 PDT 2020


mstorsjo created this revision.
mstorsjo added a reviewer: libc++.
Herald added a project: libc++.
Herald added 1 blocking reviewer(s): libc++.
mstorsjo requested review of this revision.

Prepend the root path on the already_absolute testcase, and construct a path ending with the preferred separator for the test reference for "foo/".

Additionally, the "" case fails both on MS STL and libstdc++, where it returns an empty string (and libstdc++ sets the error code). Unsure what to do with that one - make it libcpp specific, or consider the other implementations being wrong in thas aspect?


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89944

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


Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp
===================================================================
--- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp
+++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp
@@ -42,8 +42,8 @@
     } TestCases [] = {
         {"", cwd / ""},
         {"foo", cwd / "foo"},
-        {"foo/", cwd / "foo/"},
-        {"/already_absolute", "/already_absolute"}
+        {"foo/", cwd / "foo" / ""},
+        {"/already_absolute", cwd.root_path() / "already_absolute"}
     };
     for (auto& TC : TestCases) {
         std::error_code ec = GetTestEC();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89944.299911.patch
Type: text/x-patch
Size: 715 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20201022/ddb92e8a/attachment.bin>


More information about the libcxx-commits mailing list