mirror of
https://git.mirrors.martin98.com/https://github.com/gulrak/filesystem
synced 2025-06-04 11:13:58 +08:00
Added std::string_view test checks when __cpp_lib_string_view is defined
This commit is contained in:
parent
4b10425417
commit
79fb211570
@ -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]")
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user