Add StringMaker for std::(w)string_view
Fixes #1375
diff --git a/projects/SelfTest/UsageTests/ToStringGeneral.tests.cpp b/projects/SelfTest/UsageTests/ToStringGeneral.tests.cpp
index 3f6fa05..acddf22 100644
--- a/projects/SelfTest/UsageTests/ToStringGeneral.tests.cpp
+++ b/projects/SelfTest/UsageTests/ToStringGeneral.tests.cpp
@@ -116,6 +116,18 @@
}
}
+#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
+
+TEST_CASE("String views are stringified like other strings", "[toString][approvals]") {
+ std::string_view view{"abc"};
+ CHECK(Catch::Detail::stringify(view) == R"("abc")");
+
+ std::string_view arr[] { view };
+ CHECK(Catch::Detail::stringify(arr) == R"({ "abc" })");
+}
+
+#endif
+
namespace {
struct WhatException : std::exception {