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(path) value is equal to another.
Pseudocode:
std::fs::read_to_string(path1) = std::fs::read_to_string(path2)
-
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)`
// https://docs.rs/assertables/8.7.0/assertables/macro.assert_fs_read_to_string_eq.html
// 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\"`