macro_rules! assert_success_false {
($a:expr $(,)?) => { ... };
($a:expr, $($message:tt)+) => { ... };
}
Expand description
Assert a failure method is true.
Pseudocode:
a.success() = false
-
If true, return
true
. -
Otherwise, call
panic!
with a message and the values of the expressions with their debug representations.
§Examples
use assertables::*;
#[derive(Debug)]
struct A;
impl A { fn success(&self) -> bool { false }}
let a = A{};
assert_success_false!(a);
// This will panic
#[derive(Debug)]
struct A;
impl A { fn success(&self) -> bool { true }}
let a = A{};
assert_success_false!(a);
// assertion failed: `assert_success_false!(a)`
// https://docs.rs/assertables/…/assertables/macro.assert_success_false.html
// a label: `a`,
// a debug: `A`