Macro assertables::assert_io_read_to_string_eq

source ·
macro_rules! assert_io_read_to_string_eq {
    ($a_reader:expr, $b:expr $(,)?) => { ... };
    ($a_reader:expr, $b:expr, $($message:tt)+) => { ... };
}
Expand description

Assert a std::io::Read read_to_string() value is equal to another.

  • If 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 = "alfa".as_bytes();
let mut b = "alfa".as_bytes();
assert_io_read_to_string_eq!(a, b);

let mut a = "alfa".as_bytes();
let mut b = "bravo".as_bytes();
assert_io_read_to_string_eq!(a, b);
// assertion failed: `assert_io_read_to_string_eq!(a_reader, b_reader)`
//  a label: `a`,
//  a debug: `[]`,
//  b label: `b`,
//  b debug: `[]`,
//        a: `\"alfa\"`,
//        b: `\"bravo\"`

§Module macros