Clean output

This commit is contained in:
ritiek 2018-01-04 19:56:57 +05:30
parent 687d3d15ba
commit 45c2c9afa5

View File

@ -2708,15 +2708,16 @@ fn compare_output(&self, kind: &str, actual: &str, expected: &str) -> usize {
return 0;
}
println!("normalized {}:\n{}\n", kind, actual);
println!("expected {}:\n{}\n", kind, expected);
println!("diff of {}:\n", kind);
for diff in diff::lines(expected, actual) {
match diff {
diff::Result::Left(l) => println!("-{}", l),
diff::Result::Both(l, _) => println!(" {}", l),
diff::Result::Right(r) => println!("+{}", r),
if expected.is_empty() {
println!("normalized {}:\n{}\n", kind, actual);
} else {
println!("diff of {}:\n", kind);
for diff in diff::lines(expected, actual) {
match diff {
diff::Result::Left(l) => println!("-{}", l),
diff::Result::Right(r) => println!("+{}", r),
_ => {},
}
}
}