Macro assertables::assume_io_ne [−][src]
macro_rules! assume_io_ne { ($left:expr, $right:expr $(,)?) => { ... }; ($left:expr, $right:expr, $($arg:tt)+) => { ... }; }
Expand description
Assume one value is not equal to another value.
-
When true, return
Ok(true). -
When false, return
Ok(false). -
Otherwise, return
Errwith a message and the values of the expressions with their debug representations.
Examples
let x = assume_io_ne!(1, 1); //-> Ok(true)
let x = assume_io_ne!(1, 2); //-> Err( // std::io::Error::new( // std::io::ErrorKind::InvalidInput, // "assumption failed: `assume_io_ne(left, right)`\n left: `1`\n right: `2`")] // ) // )
This macro has a second form where a custom message can be provided.