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.
Pseudocode:
(a_reader.read_to_string(a_string) ⇒ a_string) = (b_reader.read_to_string(b_string) ⇒ b_string)
-
If true, return
(a_string, b_string). -
Otherwise, call
panic!with a message and the values of the expressions with their debug representations.
§Examples
use assertables::*;
use std::io::Read;
let a = "alfa".as_bytes();
let b = "alfa".as_bytes();
assert_io_read_to_string_eq!(a, b);
// This will panic
let a = "alfa".as_bytes();
let b = "zz".as_bytes();
assert_io_read_to_string_eq!(a, b);
// assertion failed: `assert_io_read_to_string_eq!(a_reader, b_reader)`
// https://docs.rs/assertables/…/assertables/macro.assert_io_read_to_string_eq.html
// a label: `a`,
// a debug: `[97, 108, 102, 97]`,
// b label: `b`,
// b debug: `[122, 122]`,
// a: `\"alfa\"`,
// b: `\"zz\"`