From edc0a6da504d0816cd7f5598eca3c9541fbd3959 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 25 Nov 2026 09:35:53 -0800 Subject: [PATCH] Tests: floated panel bodies stay within the requested width The narrow-panel row tests compared each control with the floating panel's body but never checked the body itself, so a body wider than the requested width would let controls past the panel edge pass. floated() now asserts the body is no wider than the width the float asked for. --- crates/ui-egui/src/panels/tests_panel_rows.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/ui-egui/src/panels/tests_panel_rows.rs b/crates/ui-egui/src/panels/tests_panel_rows.rs index e536facd0d..6f6e099900 100644 --- a/crates/ui-egui/src/panels/tests_panel_rows.rs +++ b/crates/ui-egui/src/panels/tests_panel_rows.rs @@ -60,6 +60,7 @@ fn floated(panel: &str, lang: &str, width: f32, names: &[&str]) -> (egui::Rect, .filter(|(_, n)| n.role() == Role::TabPanel) .find_map(|(_, n)| rect(n).filter(|r| (r.left() - AT).abs() < 1.0)) .unwrap_or_else(|| panic!("{panel} does not float at x {AT}")); + assert!(body.width() <= width + 1.0, "{panel}'s body {body:?} is wider than the {width} the float asked for"); let controls = shown .into_iter() .map(|name| {