Function snapbox::assert_matches
source · pub fn assert_matches(pattern: impl Into<Data>, actual: impl Into<Data>)Expand description
Check if a value matches a pattern
Pattern syntax:
...is a line-wildcard when on a line by itself[..]is a character-wildcard when inside a line[EXE]matches.exeon Windows
Normalization:
- Newlines
\to/
let output = "something";
let expected = "so[..]g";
assert_matches(expected, output);Can combine this with file!
let actual = "something";
assert_matches(file!["output.txt"], actual);