From 00ed9c1547a13f5d94881975e3872b68d5457686 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Sun, 30 Mar 2025 20:29:52 +0200 Subject: [PATCH] Be more forgiving in our comparison --- crates/epaint/src/text/fonts.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/epaint/src/text/fonts.rs b/crates/epaint/src/text/fonts.rs index 4a7da64a3..eebda16be 100644 --- a/crates/epaint/src/text/fonts.rs +++ b/crates/epaint/src/text/fonts.rs @@ -1107,9 +1107,10 @@ mod tests { } // Don't compare for equaliity; but format with a specific precision and make sure we hit that. + // NOTE: we use a rather low precision, because as long as we're within a pixel I think it's good enough. similar_asserts::assert_eq!( - format!("{:#.5?}", split), - format!("{:#.5?}", whole), + format!("{:#.1?}", split), + format!("{:#.1?}", whole), "pixels_per_point: {pixels_per_point:.2}, input text: '{}'", job.text );