2019-11-29 Tom Honermann <tom@honermann.net>
+ Updates to existing tests
+ * testsuite/experimental/feat-char8_t.cc: Updated the expected
+ __cpp_lib_char8_t feature test macro value.
+ * testsuite/27_io/filesystem/path/factory/u8path.cc: Added testing of
+ u8path invocation with std::string, std::string_view, and iterators
+ thereof.
+ * testsuite/experimental/filesystem/path/factory/u8path.cc: Added
+ testing of u8path invocation with std::string, std::string_view, and
+ iterators thereof.
+
Update feature test macro, add deleted operators, update u8path
* include/bits/c++config: Bumped the value of the __cpp_lib_char8_t
feature test macro.
// { dg-do run { target c++17 } }
#include <filesystem>
+#include <string_view>
#include <testsuite_hooks.h>
namespace fs = std::filesystem;
p = fs::u8path("\xf0\x9d\x84\x9e");
VERIFY( p.u8string() == u8"\U0001D11E" );
+
+ std::string s1 = "filename2";
+ p = fs::u8path(s1);
+ VERIFY( p.u8string() == u8"filename2" );
+
+ std::string s2 = "filename3";
+ p = fs::u8path(s2.begin(), s2.end());
+ VERIFY( p.u8string() == u8"filename3" );
+
+ std::string_view sv1{ s1 };
+ p = fs::u8path(sv1);
+ VERIFY( p.u8string() == u8"filename2" );
+
+ std::string_view sv2{ s2 };
+ p = fs::u8path(sv2.begin(), sv2.end());
+ VERIFY( p.u8string() == u8"filename3" );
}
void
#ifndef __cpp_lib_char8_t
# error "__cpp_lib_char8_t"
-#elif __cpp_lib_char8_t != 201811L
-# error "__cpp_lib_char8_t != 201811L"
+#elif __cpp_lib_char8_t != 201907L
+# error "__cpp_lib_char8_t != 201907L"
#endif
p = fs::u8path("\xf0\x9d\x84\x9e");
VERIFY( p.u8string() == u8"\U0001D11E" );
+
+ std::string s1 = "filename2";
+ p = fs::u8path(s1);
+ VERIFY( p.u8string() == u8"filename2" );
+
+ std::string s2 = "filename3";
+ p = fs::u8path(s2.begin(), s2.end());
+ VERIFY( p.u8string() == u8"filename3" );
}
void