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:
Martin Hořeňovský
2020-04-21 11:00:08 +02:00
parent 2a93a65bc2
commit 53434a2f32
11 changed files with 106 additions and 8 deletions

View File

@@ -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