Macro assertables::assert_read_to_string_ne
source · [−]macro_rules! assert_read_to_string_ne {
($left:expr, $right:expr $(,)?) => { ... };
($left:expr, $right:expr, $($arg:tt)+) => { ... };
}Expand description
Assert a std::io::Read read_to_string() is not equal to another.
-
When true, return
(). -
Otherwise, call
panic!with a message and the values of the expressions with their debug representations.
Examples
use std::io::Read;
let mut a = "a".as_bytes();
let mut b = "b".as_bytes();
assert_read_to_string_ne!(a, b);
//-> ()
use std::io::Read;
let mut a = "a".as_bytes();
let mut b = "a".as_bytes();
assert_read_to_string_ne!(a, b);
//-> panic!
// assertion failed: `assert_read_to_string_ne!(left, right)`
// left: `\"a\"`,
// right: `\"a\"`This macro has a second form where a custom message can be provided.