From 36bd6451c8ed3bafd9d1a0975ca17d7150d4ea9b Mon Sep 17 00:00:00 2001 From: FredApps <153173854+FredApps@users.noreply.github.com> Date: Thu, 5 Nov 2026 15:29:08 +0100 Subject: [PATCH] Tests: a fitted credits table fills the window exactly The table ends on the window edge, which the layout rounds to whole points, so the check allows that edge. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/dialogs/credits/ui_tests.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/dialogs/credits/ui_tests.rs b/crates/ui-egui/src/dialogs/credits/ui_tests.rs index 0791a844f..cc2df5786 100644 --- a/crates/ui-egui/src/dialogs/credits/ui_tests.rs +++ b/crates/ui-egui/src/dialogs/credits/ui_tests.rs @@ -354,9 +354,10 @@ fn a_changed_fit_replaces_the_column_widths() { let wider = table_frame(&ctx, WINDOW, &[None, Some(200.0), Some(80.0)], NAME, Vec::new()); let widths: Vec = wider.iter().map(|c| c.width().round()).collect(); assert!(widths.ends_with(&[200.0, 80.0]), "a longer cell widens its column: {widths:?}"); - assert!(wider[2].right() < WINDOW, "the table still fits the window: {wider:?}"); + // The table fills the window, which the layout rounds to whole points. + assert!(wider[2].right() <= WINDOW.ceil(), "the table still fits the window: {wider:?}"); let narrower = table_frame(&ctx, 400.0, &WIDTHS, NAME, Vec::new()); - assert!(narrower[2].right() < 400.0, "a narrower window refits the table: {narrower:?}"); + assert!(narrower[2].right() <= 400.0, "a narrower window refits the table: {narrower:?}"); } #[test]