Macro assertables::assume_eq[][src]

macro_rules! assume_eq {
    ($left:expr, $right:expr $(,)?) => { ... };
    ($left:expr, $right:expr, $($arg:tt)+) => { ... };
}

Assume two values are equal.

  • When true, return Ok(true).

  • Otherwise, return Err with a message and the values of the expressions with their debug representations.

Example

let x = assume_lt!(1, 2);
//-> Ok(true)
let x = assume_lt!(2, 1);
//-> Ok(false)

This macro has a second form where a custom message can be provided.