diff --git a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp --- a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp +++ b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.absolute/absolute.pass.cpp @@ -42,15 +42,16 @@ } TestCases [] = { {"", cwd / ""}, {"foo", cwd / "foo"}, - {"foo/", cwd / "foo" / ""}, - {"/already_absolute", cwd.root_path() / "already_absolute"} + {"foo/", cwd / "foo/"}, + {"/already_absolute", cwd.root_name() / "/already_absolute"} }; for (auto& TC : TestCases) { std::error_code ec = GetTestEC(); const path ret = absolute(TC.input, ec); TEST_CHECK(!ec); TEST_CHECK(ret.is_absolute()); - TEST_CHECK(PathEq(ret, TC.expect)); + TEST_CHECK(PathEqIgnoreSep(ret, TC.expect)); + LIBCPP_ONLY(TEST_CHECK(PathEq(ret, TC.expect))); } } diff --git a/libcxx/test/support/filesystem_test_helper.h b/libcxx/test/support/filesystem_test_helper.h --- a/libcxx/test/support/filesystem_test_helper.h +++ b/libcxx/test/support/filesystem_test_helper.h @@ -591,6 +591,12 @@ return LHS.native() == RHS.native(); } +inline bool PathEqIgnoreSep(fs::path LHS, fs::path RHS) { + LHS.make_preferred(); + RHS.make_preferred(); + return LHS.native() == RHS.native(); +} + struct ExceptionChecker { std::errc expected_err; fs::path expected_path1;