diff options
| author | Martin Hořeňovský | 2023-02-10 23:25:41 +0100 |
|---|---|---|
| committer | Martin Hořeňovský | 2023-02-10 23:25:45 +0100 |
| commit | e8ba329b6c66b06c4afd07953020b74c4b0f1a75 (patch) | |
| tree | 10d2a26eeb666669705601f1b090925bb3b248d1 /tests | |
| parent | 4aa88299af4d4d7dec18a1b6cf314a4b03d7567c (diff) | |
| download | catch3-e8ba329b6c66b06c4afd07953020b74c4b0f1a75.tar.gz | |
Add support for iterator+sentinel pairs in Contains matcher
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/SelfTest/UsageTests/MatchersRanges.tests.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/SelfTest/UsageTests/MatchersRanges.tests.cpp b/tests/SelfTest/UsageTests/MatchersRanges.tests.cpp index 8b1420c9..05e11b0c 100644 --- a/tests/SelfTest/UsageTests/MatchersRanges.tests.cpp +++ b/tests/SelfTest/UsageTests/MatchersRanges.tests.cpp @@ -646,6 +646,16 @@ TEST_CASE( "RangeEquals supports ranges with different types returned from begin REQUIRE_THAT( diff_types, UnorderedRangeEquals( diff_types ) ); } +TEST_CASE( "RangeContains supports ranges with different types returned from " + "begin and end", + "[matchers][templated][range][approvals]" ) { + using Catch::Matchers::Contains; + + has_different_begin_end_types<size_t> diff_types{ 1, 2, 3, 4, 5 }; + REQUIRE_THAT( diff_types, Contains( size_t( 3 ) ) ); + REQUIRE_THAT( diff_types, Contains( LessThanMatcher( size_t( 4 ) ) ) ); +} + #endif TEST_CASE( "Usage of RangeEquals range matcher", "[matchers][templated][quantifiers]" ) { |