1
0
mirror of https://github.com/catchorg/Catch2.git synced 2025-07-22 19:04:38 -04:00

Add support for iterator+sentinel pairs in Contains matcher

This commit is contained in:
Martin Hořeňovský
2023-02-10 23:25:41 +01:00
parent 4aa88299af
commit e8ba329b6c
2 changed files with 16 additions and 8 deletions
src/catch2/matchers
tests/SelfTest/UsageTests

@ -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]" ) {