Macro googletest::matchers::all

source ·
macro_rules! all {
    ($($matcher:expr),* $(,)?) => { ... };
}
Expand description

Matches a value which all of the given matchers match.

Each argument is a Matcher which matches against the actual value.

For example:

verify_that!("A string", all!(starts_with("A"), ends_with("string")))?; // Passes
verify_that!("A string", all!(starts_with("A"), ends_with("not a string")))?; // Fails

Using this macro is equivalent to using the and method:

verify_that!(10, gt(9).and(lt(11)))?; // Also passes

Assertion failure messages are not guaranteed to be identical, however.