summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/27_io/filesystem/path
diff options
context:
space:
mode:
authorTom Honermann <tom@honermann.net>2019-11-29 17:43:46 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2019-11-29 17:43:46 +0000
commit2b68cdc7e57bc632acba95a1e798493288f0e131 (patch)
treec7cf8ee41285572f8bc31fab179000be2bffb70f /libstdc++-v3/testsuite/27_io/filesystem/path
parent2b4e2c93d908afb575b7f9bcd0c8c9ad63e717d0 (diff)
libstdc++: P1423R3 char8_t remediation (3/4)
Updates to existing tests This patch updates existing tests to validate the new value for the __cpp_lib_char8_t feature test macros and to exercise u8path factory function invocations with std::string, std::string_view, and interator pair arguments. 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. From-SVN: r278857
Diffstat (limited to 'libstdc++-v3/testsuite/27_io/filesystem/path')
-rw-r--r--libstdc++-v3/testsuite/27_io/filesystem/path/factory/u8path.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/libstdc++-v3/testsuite/27_io/filesystem/path/factory/u8path.cc b/libstdc++-v3/testsuite/27_io/filesystem/path/factory/u8path.cc
index aff722b5867..fb337ce1284 100644
--- a/libstdc++-v3/testsuite/27_io/filesystem/path/factory/u8path.cc
+++ b/libstdc++-v3/testsuite/27_io/filesystem/path/factory/u8path.cc
@@ -19,6 +19,7 @@
// { dg-do run { target c++17 } }
#include <filesystem>
+#include <string_view>
#include <testsuite_hooks.h>
namespace fs = std::filesystem;
@@ -34,6 +35,22 @@ test01()
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