diff options
| author | Sean Middleditch | 2020-08-18 01:34:47 -0700 |
|---|---|---|
| committer | Martin Hořeňovský | 2020-09-07 14:23:47 +0200 |
| commit | 31d483124532184aefc9595903af7493c206b874 (patch) | |
| tree | a8acde3177a120accb08b1953d721a9d4b1dd5a4 /tests/SelfTest/IntrospectiveTests/ToString.tests.cpp | |
| parent | 08fb5cbab2f8cf59c6960da9d7b54e5841bfd097 (diff) | |
| download | catch3-31d483124532184aefc9595903af7493c206b874.tar.gz | |
Support sentinel-based ranges in default stringify (#2004)
Diffstat (limited to 'tests/SelfTest/IntrospectiveTests/ToString.tests.cpp')
| -rw-r--r-- | tests/SelfTest/IntrospectiveTests/ToString.tests.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/SelfTest/IntrospectiveTests/ToString.tests.cpp b/tests/SelfTest/IntrospectiveTests/ToString.tests.cpp index b50a4012..47dfdd37 100644 --- a/tests/SelfTest/IntrospectiveTests/ToString.tests.cpp +++ b/tests/SelfTest/IntrospectiveTests/ToString.tests.cpp @@ -4,6 +4,13 @@ enum class EnumClass3 { Value1, Value2, Value3, Value4 }; +struct UsesSentinel { + using const_iterator = int const*; + using const_sentinel = std::nullptr_t; + + const_iterator begin() const { return nullptr; } + const_iterator end() const { return nullptr; } +}; TEST_CASE( "parseEnums", "[Strings][enums]" ) { using namespace Catch::Matchers; @@ -40,3 +47,7 @@ TEST_CASE( "Directly creating an EnumInfo" ) { CHECK( enumInfo->lookup(1) == "Value2" ); CHECK( enumInfo->lookup(3) == "{** unexpected enum value **}" ); } + +TEST_CASE("Range type with sentinel") { + CHECK( Catch::Detail::stringify(UsesSentinel{}) == "{ }" ); +}
\ No newline at end of file |