macro_rules! expect_gt {
($actual:expr, $expected:expr, $($format_args:expr),+ $(,)?) => { ... };
($actual:expr, $expected:expr $(,)?) => { ... };
}Expand description
Marks test as failed and continues execution if the first argument is not greater than the second argument.
This is a not-fatal failure. The test continues execution even after the macro execution.
This can only be invoked inside tests with the
gtest attribute. The failure must be generated
in the same thread as that running the test itself.
Example:
ⓘ
use googletest::prelude::*;
#[gtest]
fn should_fail() {
expect_gt!(1, 2);
println!("This will print!");
}One may include formatted arguments in the failure message:
ⓘ
use googletest::prelude::*;
#[gtest]
fn should_fail() {
let argument = "argument"
expect_gt!(1, 2, "custom failure message: {argument}");
println!("This will print!");
}