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 <noreply@anthropic.com>
This commit is contained in:
FredApps
2026-11-05 15:29:08 +01:00
co-authored by Claude Opus 5.5
parent 9748583f84
commit 36bd6451c8
@@ -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<f32> = 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]