Added std::string_view test checks when __cpp_lib_string_view is defined

This commit is contained in:
Steffen Schuemann 2019-08-15 14:47:13 +02:00
parent 4b10425417
commit 79fb211570

View File

@ -2602,6 +2602,19 @@ TEST_CASE("30.10.15.39 weakly_canonical", "[filesystem][operations][fs.op.weakly
}
}
TEST_CASE("std::string_view support", "[filesystem][fs.string_view]")
{
#if __cpp_lib_string_view
std::string p("foo/bar");
std::string_view sv(p);
CHECK(fs::path(sv, fs::path::format::generic_format).generic_string() == "foo/bar");
fs::path p2("fo");
p2 += std::string_view("o");
CHECK(p2 == "foo");
CHECK(p2.compare(std::string_view("foo")) == 0);
#endif
}
#ifdef GHC_OS_WINDOWS
TEST_CASE("Windows: Long filename support", "[filesystem][path][fs.path.win.long]")
{