mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-02 21:35:40 +02:00
Support bitand and bitor in REQUIRE/CHECK
This means that bit-flag-like types with conversion to bool can be asserted on, like so `REQUIRE(var & Flags::AddNewline)`.
This commit is contained in:
@@ -488,6 +488,12 @@ ok {test-number} - 1, !Predicate<int>(alwaysFalse, "always false") for: 1 not ma
|
||||
ok {test-number} - "Hello olleH", Predicate<std::string>( [] (std::string const& str) -> bool { return str.front() == str.back(); }, "First and last character should be equal") for: "Hello olleH" matches predicate: "First and last character should be equal"
|
||||
# Arbitrary predicate matcher
|
||||
ok {test-number} - "This wouldn't pass", !Predicate<std::string>( [] (std::string const& str) -> bool { return str.front() == str.back(); } ) for: "This wouldn't pass" not matches undescribed predicate
|
||||
# Assertion macros support bit operators and bool conversions
|
||||
ok {test-number} - lhs | rhs for: Val: 1 | Val: 2
|
||||
# Assertion macros support bit operators and bool conversions
|
||||
ok {test-number} - !(lhs & rhs) for: !(Val: 1 & Val: 2)
|
||||
# Assertion macros support bit operators and bool conversions
|
||||
ok {test-number} - HasBitOperators{ 1 } & HasBitOperators{ 1 } for: Val: 1 & Val: 1
|
||||
# Assertions then sections
|
||||
ok {test-number} - true
|
||||
# Assertions then sections
|
||||
@@ -3810,5 +3816,5 @@ ok {test-number} - q3 == 23. for: 23.0 == 23.0
|
||||
ok {test-number} -
|
||||
# xmlentitycheck
|
||||
ok {test-number} -
|
||||
1..1901
|
||||
1..1904
|
||||
|
||||
|
Reference in New Issue
Block a user