More logging when test fails.

This commit is contained in:
Bill Thiede 2019-12-09 19:36:41 -08:00
parent da717aeae1
commit b3ca6e1cb3

View File

@ -211,8 +211,9 @@ fn test_roundtrip_library() -> Result<(), Box<dyn Error>> {
fn validate_duplicates(got: Vec<(&Movie, Vec<&Movie>)>, want: Vec<(Movie, Vec<Movie>)>) { fn validate_duplicates(got: Vec<(&Movie, Vec<&Movie>)>, want: Vec<(Movie, Vec<Movie>)>) {
assert_eq!(got.len(), want.len()); assert_eq!(got.len(), want.len());
for (g, w) in got.iter().zip(&want) { for (g, w) in got.iter().zip(&want) {
assert_eq!(g.0, &w.0); assert_eq!(g.0, &w.0, "Got:\n{:?}\nWant:\n{:?}", g, w);
assert_eq!(g.1, w.1.iter().map(|v| v).collect::<Vec<_>>()); let want = w.1.iter().map(|v| v).collect::<Vec<_>>();
assert_eq!(g.1, want, "Got:\n{:?}\nWant:\n{:?}", g, w);
} }
} }