Macro assertables::assert_io_read_to_string_lt

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

Assert a std::io::Read read_to_string() value is less than another.

Pseudocode:
(reader1.read_to_string(a) ⇒ a) < (reader2.read_to_string(b) ⇒ b)

  • 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 = "bravo".as_bytes();
assert_io_read_to_string_lt!(a, b);

let mut a = "bravo".as_bytes();
let mut b = "alfa".as_bytes();
assert_io_read_to_string_lt!(a, b);
// assertion failed: `assert_io_read_to_string_lt!(a_reader, b_reader)`
// https://docs.rs/assertables/8.7.0/assertables/macro.assert_io_read_to_string_lt.html
//  a label: `a`,
//  a debug: `[]`,
//  b label: `b`,
//  b debug: `[]`,
//        a: `\"bravo\"`,
//        b: `\"alfa\"`

§Module macros