Macro assertables::assert_fs_read_to_string_eq

source ·
macro_rules! assert_fs_read_to_string_eq {
    ($a_path:expr, $b_path:expr $(,)?) => { ... };
    ($a_path:expr, $b_path:expr, $($message:tt)+) => { ... };
}
Expand description

Assert a std::fs::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 a = "alfa.txt";
let b = "alfa.txt";
assert_fs_read_to_string_eq!(&a, &b);

let a = "alfa.txt";
let b = "bravo.txt";
assert_fs_read_to_string_eq!(&a, &b);
// assertion failed: `assert_fs_read_to_string_eq!(a_path, b_path)`
//  a_path label: `&a`,
//  a_path debug: `\"alfa.txt\"`,
//  b_path label: `&b`,
//  b_path debug: `\"bravo.txt\"`,
//      a string: `\"alfa\\n\"`,
//      b string: `\"bravo\\n\"`

§Module macros