Add CaseInsensitiveEqualTo comparison type

This commit is contained in:
Martin Hořeňovský
2021-12-26 18:54:47 +01:00
parent 156e6fdfa9
commit cbb6764fb1
12 changed files with 358 additions and 8 deletions
@@ -22,5 +22,14 @@ namespace Catch {
[]( char l, char r ) { return toLower( l ) < toLower( r ); } );
}
bool
CaseInsensitiveEqualTo::operator()( StringRef lhs,
StringRef rhs ) const {
return std::equal(
lhs.begin(), lhs.end(),
rhs.begin(), rhs.end(),
[]( char l, char r ) { return toLower( l ) == toLower( r ); } );
}
} // namespace Detail
} // namespace Catch