Macro assertables::assume_gt[][src]

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

Assume one value is greater than another value.

  • 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_gt!(2, 1);
//-> Ok(true)
let x = assume_gt!(1, 2);
//-> Err("assumption failed: `assume_gt(left, right)`\n  left: `1`\n right: `2`")

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