From 06433ccb3c915f0a1c2f1a9186aa255b4647d589 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Sch=C3=BCmann?= Date: Wed, 30 Dec 2020 11:33:15 +0100 Subject: [PATCH] refs #71, fixing windows u8 literal test issue --- test/filesystem_test.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/filesystem_test.cpp b/test/filesystem_test.cpp index f97f26e..eb9e879 100644 --- a/test/filesystem_test.cpp +++ b/test/filesystem_test.cpp @@ -127,6 +127,14 @@ struct StringMaker static std::string convert(fs::perms const& value) { return std::to_string(static_cast(value)); } }; +#ifdef __cpp_lib_char8_t +template <> +struct StringMaker +{ + static std::string convert(char8_t const& value) { return std::to_string(static_cast(value)); } +}; +#endif + template <> struct StringMaker { @@ -559,7 +567,7 @@ TEST_CASE("30.10.8.4.6 path native format observers", "[filesystem][path][fs.pat #endif CHECK(fs::u8path("\xc3\xa4\\\xe2\x82\xac").wstring() == std::wstring(L"\u00E4\\\u20AC")); #if defined(__cpp_lib_char8_t) && !defined(GHC_FILESYSTEM_ENFORCE_CPP17_API) - CHECK(fs::u8path("\xc3\xa4\\\xe2\x82\xac").u8string() == std::u8string(u8"\xc3\xa4\\\xe2\x82\xac")); + CHECK(fs::u8path("\xc3\xa4\\\xe2\x82\xac").u8string() == std::u8string(u8"\u00E4\\\u20AC")); #else CHECK(fs::u8path("\xc3\xa4\\\xe2\x82\xac").u8string() == std::string("\xc3\xa4\\\xe2\x82\xac")); #endif @@ -595,7 +603,7 @@ TEST_CASE("30.10.8.4.7 path generic format observers", "[filesystem][path][fs.pa #endif CHECK(fs::u8path("\xc3\xa4\\\xe2\x82\xac").generic_wstring() == std::wstring(L"\U000000E4/\U000020AC")); #if defined(__cpp_lib_char8_t) && !defined(GHC_FILESYSTEM_ENFORCE_CPP17_API) - CHECK(fs::u8path("\xc3\xa4\\\xe2\x82\xac").generic_u8string() == std::u8string(u8"\xc3\xa4/\xe2\x82\xac")); + CHECK(fs::u8path("\xc3\xa4\\\xe2\x82\xac").generic_u8string() == std::u8string(u8"\u00E4/\u20AC")); #else CHECK(fs::u8path("\xc3\xa4\\\xe2\x82\xac").generic_u8string() == std::string("\xc3\xa4/\xe2\x82\xac")); #endif