Add StringMaker for std::(w)string_view

Fixes #1375
This commit is contained in:
melak47 2018-09-04 17:01:26 +02:00 committed by Martin Hořeňovský
parent 1eb42eed97
commit a575536abe
5 changed files with 68 additions and 13 deletions

View file

@ -116,6 +116,18 @@ TEST_CASE("Static arrays are convertible to string", "[toString]") {
}
}
#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 {