Module assertables::assert_fs_read_to_string
source · Expand description
Assert macros for comparing file system path contents.
These macros help with file system paths, such as disk files, Path,
PathBuf, the trait AsRef<Path>, and anything that is readable via
std::fs::read_to_string(…).
Compare a path with another path:
-
assert_fs_read_to_string_eq!(path1, path2)≈ std::fs::read_to_string(path1) = std::fs::read_to_string(path2) -
assert_fs_read_to_string_ne!(path1, path2)≈ std::fs::read_to_string(path1) ≠ std::fs::read_to_string(path2) -
assert_fs_read_to_string_ge!(path1, path2)≈ std::fs::read_to_string(path1) ≥ std::fs::read_to_string(path2) -
assert_fs_read_to_string_gt!(path1, path2)≈ std::fs::read_to_string(path1) > std::fs::read_to_string(path2) -
assert_fs_read_to_string_le!(path1, path2)≈ std::fs::read_to_string(path1) ≤ std::fs::read_to_string(path2) -
assert_fs_read_to_string_lt!(path1, path2)≈ std::fs::read_to_string(path1) < std::fs::read_to_string(path2)
Compare a path with an expression:
-
assert_fs_read_to_string_eq_expr!(path, expr)≈ std::fs::read_to_string(path) = expr -
assert_fs_read_to_string_ne_expr!(path, expr)≈ std::fs::read_to_string(path) ≠ expr -
assert_fs_read_to_string_ge_expr!(path, expr)≈ std::fs::read_to_string(path) ≥ expr -
assert_fs_read_to_string_gt_expr!(path, expr)≈ std::fs::read_to_string(path) > expr -
assert_fs_read_to_string_le_expr!(path, expr)≈ std::fs::read_to_string(path) ≤ expr -
assert_fs_read_to_string_lt_expr!(path, expr)≈ std::fs::read_to_string(path) < expr
Compare a path with its contents:
-
assert_fs_read_to_string_contains!(path, containee)≈ std::fs::read_to_string(path).contains(containee) -
assert_fs_read_to_string_matches!(path, matcher)≈ matcher.is_match(std::fs::read_to_string(path))
§Example
use std::io::Read;
let a ="alfa.txt";
let b = "alfa.txt";
assert_fs_read_to_string_eq!(&a, &b);Modules§
- Assert a std::fs::read_to_string() contains a pattern.
- Assert a std::fs::read_to_string() value is equal to another.
- Assert a std::fs::read_to_string() value is equal to an expression.
- Assert a std::fs::read_to_string() value is greater than or equal to another.
- Assert a std::fs::read_to_string() value is greater than or equal to an expression.
- Assert a std::fs::read_to_string() value is greater than another.
- Assert a std::fs::read_to_string() value is greater than an expression.
- Assert a std::fs::read_to_string() value is less than or equal to another.
- Assert a std::fs::read_to_string() value is less than or equal to an expression.
- Assert a std::fs::read_to_string() value is less than another.
- Assert a std::fs::read_to_string() value is less than an expression.
- Assert a std::fs::read_to_string() is a match to a regex.
- Assert a std::fs::read_to_string() is not equal to another.
- Assert a std::fs::read_to_string() is not equal to an expression.