diff options
| author | melak47 | 2018-09-04 17:01:26 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2018-09-10 11:37:26 +0200 |
| commit | a575536abe20b58c48863600f8a71e93b4052b81 (patch) | |
| tree | 5a602a98304fa10a3f63f4cbdb45b23591e528c1 /projects/SelfTest/UsageTests/ToStringGeneral.tests.cpp | |
| parent | 1eb42eed974f944401091325bbe8e61b38fd0678 (diff) | |
| download | catch3-a575536abe20b58c48863600f8a71e93b4052b81.tar.gz | |
Add StringMaker for std::(w)string_view
Fixes #1375
Diffstat (limited to 'projects/SelfTest/UsageTests/ToStringGeneral.tests.cpp')
| -rw-r--r-- | projects/SelfTest/UsageTests/ToStringGeneral.tests.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/projects/SelfTest/UsageTests/ToStringGeneral.tests.cpp b/projects/SelfTest/UsageTests/ToStringGeneral.tests.cpp index 3f6fa05f..acddf223 100644 --- a/projects/SelfTest/UsageTests/ToStringGeneral.tests.cpp +++ b/projects/SelfTest/UsageTests/ToStringGeneral.tests.cpp @@ -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 { |