Function difference::assert_diff [] [src]

pub fn assert_diff(orig: &str, edit: &str, split: &str, expected: i32)

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).

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 using print_diff in case of failure.