From f47f80571dcc68e382f48b2610c60a926d7dc274 Mon Sep 17 00:00:00 2001 From: Matt Keeter Date: Tue, 20 Feb 2024 09:20:19 -0500 Subject: [PATCH] Also print a diff --- fidget/src/render/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fidget/src/render/mod.rs b/fidget/src/render/mod.rs index 12e5efd8..2470a13f 100644 --- a/fidget/src/render/mod.rs +++ b/fidget/src/render/mod.rs @@ -42,6 +42,10 @@ mod test { if img_str != expected { println!("image mismatch detected!"); println!("Expected:\n{expected}\nGot:\n{img_str}"); + println!("Diff:"); + for (a, b) in img_str.chars().zip(expected.chars()) { + print!("{}", if a != b { '!' } else { a }); + } panic!("image mismatch"); } }