diff --git a/test/filesystem_test.cpp b/test/filesystem_test.cpp index f36f0d3..7e0570c 100644 --- a/test/filesystem_test.cpp +++ b/test/filesystem_test.cpp @@ -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]") {