macro_rules! assert_diff {
($orig:expr_2021 , $edit:expr_2021, $split: expr_2021, $expected: expr_2021) => { ... };
}Expand description
Assert the difference between two strings. Works like diff, but takes a fourth parameter that is the expected edit distance (e.g. 0 if you want to test for equality).
To include this macro use:
#[macro_use(assert_diff)]Remember that edit distance might not be equal to your understanding of difference, for example the words “Rust” and “Dust” have an edit distance of 2 because two changes (a removal and an addition) are required to make them look the same.
Will print an error with a colorful diff in case of failure.