diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_normal.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_normal.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_normal.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_normal.pass.cpp @@ -54,10 +54,17 @@ {"/a/b/./", "/a/b/"}, {"/a/b/c/../d", "/a/b/d"}, {"/a/b/c/../d/", "/a/b/d/"}, +#ifdef _WIN32 + {"//a/", "//a/"}, + {"//a/b/", "//a/b/"}, + {"//a/b/.", "//a/b/"}, + {"//a/..", "//a/"}, +#else {"//a/", "/a/"}, {"//a/b/", "/a/b/"}, {"//a/b/.", "/a/b/"}, {"//a/..", "/"}, +#endif ///===---------------------------------------------------------------===// /// Tests specifically for the clauses under [fs.path.generic]p6 ///===---------------------------------------------------------------===// @@ -125,13 +132,15 @@ ++ID; fs::path p(TC.input); const fs::path output = p.lexically_normal(); - if (!PathEq(output, TC.expect)) { + fs::path expect(TC.expect); + expect.make_preferred(); + if (!PathEq(output, expect)) { Failed = true; std::fprintf(stderr, "TEST CASE #%d FAILED:\n" " Input: '%s'\n" " Expected: '%s'\n" " Output: '%s'\n", - ID, TC.input.c_str(), TC.expect.c_str(), output.string().c_str()); + ID, TC.input.c_str(), expect.string().c_str(), output.string().c_str()); } } return Failed; diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_relative_and_proximate.pass.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_relative_and_proximate.pass.cpp --- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_relative_and_proximate.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.gen/lexically_relative_and_proximate.pass.cpp @@ -36,9 +36,15 @@ {"a", "/", ""}, {"//net", "a", ""}, {"a", "//net", ""}, +#ifdef _WIN32 + {"//net/", "//net", ""}, + {"//net", "//net/", ""}, + {"//base", "a", ""}, +#else {"//net/", "//net", "."}, {"//net", "//net/", "."}, {"//base", "a", ""}, +#endif {"a", "a", "."}, {"a/b", "a/b", "."}, {"a/b/c/", "a/b/c/", "."}, @@ -59,6 +65,8 @@ ++ID; const fs::path p(TC.input); const fs::path output = p.lexically_relative(TC.base); + fs::path expect(TC.expect); + expect.make_preferred(); auto ReportErr = [&](const char* Testing, fs::path const& Output, fs::path const& Expected) { Failed = true; @@ -71,8 +79,8 @@ ID, Testing, TC.input.c_str(), TC.base.c_str(), Expected.string().c_str(), Output.string().c_str()); }; - if (!PathEq(output, TC.expect)) - ReportErr("path::lexically_relative", output, TC.expect); + if (!PathEq(output, expect)) + ReportErr("path::lexically_relative", output, expect); const fs::path proximate_output = p.lexically_proximate(TC.base); // [path.gen] lexically_proximate // Returns: If the value of lexically_relative(base) is not an empty path,