Fix tests.
This commit is contained in:
parent
52298bd96c
commit
c63f30a6a2
@ -237,11 +237,14 @@ mod generate_tests {
|
|||||||
let expected = expected.to_string();
|
let expected = expected.to_string();
|
||||||
if &actual != &expected {
|
if &actual != &expected {
|
||||||
let mut counter = 0;
|
let mut counter = 0;
|
||||||
let iter = actual
|
let iter = actual.chars().zip(expected.chars()).skip_while(|(a, e)| {
|
||||||
.chars()
|
if *a == *e {
|
||||||
.zip(expected.chars())
|
counter += 1;
|
||||||
.inspect(|_| counter += 1)
|
true
|
||||||
.skip_while(|(a, e)| *a == *e);
|
} else {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
});
|
||||||
let (actual_diff, expected_diff) = {
|
let (actual_diff, expected_diff) = {
|
||||||
let mut actual_diff = String::new();
|
let mut actual_diff = String::new();
|
||||||
let mut expected_diff = String::new();
|
let mut expected_diff = String::new();
|
||||||
@ -252,8 +255,10 @@ mod generate_tests {
|
|||||||
(actual_diff, expected_diff)
|
(actual_diff, expected_diff)
|
||||||
};
|
};
|
||||||
eprintln!("actual != expected, diverge at char {}", counter);
|
eprintln!("actual != expected, diverge at char {}", counter);
|
||||||
|
eprintln!(" actual: {}", actual_diff);
|
||||||
|
eprintln!("expected: {}", expected_diff);
|
||||||
|
assert!(false);
|
||||||
}
|
}
|
||||||
assert_eq!(actual, expected);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user