Macro assert_fs_read_to_string_le

Source
macro_rules! assert_fs_read_to_string_le {
    ($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 less than or 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 = "bravo.txt";
assert_fs_read_to_string_le!(a, b);

// This will panic
let a = "bravo.txt";
let b = "alfa.txt";
assert_fs_read_to_string_le!(a, b);
// assertion failed: `assert_fs_read_to_string_le!(a_path, b_path)`
// https://docs.rs/assertables/…/assertables/macro.assert_fs_read_to_string_le.html
//  a_path label: `a`,
//  a_path debug: `\"bravo.txt\"`,
//  b_path label: `b`,
//  b_path debug: `\"alfa.txt\"`,
//      a string: `\"bravo\\n\"`,
//      b string: `\"alfa\\n\"`

§Module macros