Macro 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(path) value is equal to another.

Pseudocode:
std::fs::read_to_string(a_path) = std::fs::read_to_string(b_path)

  • If true, return (a_path_into_string, b_path_into_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.txt";
let b = "alfa.txt";
assert_fs_read_to_string_eq!(&a, &b);

// This will panic
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/9.5.4/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\"`

§Module macros