From d1428ef27c63d1a49a7e828608b71b41c596b4b3 Mon Sep 17 00:00:00 2001 From: bherbruck Date: Sat, 10 Oct 2026 03:47:00 +0000 Subject: [PATCH] UI tests clear the frame's texture changes: no "Dropped TexturesDelta" panic in debug builds drive_value_takes_the_keyboard and boundary_fill_finds_the_cells_and_fills_the_ticked_ones dropped egui's output with texture deltas still pending (epaint's debug check); they clear them as the scenario harness does. All ui-egui tests pass in a debug build. Fixes #60 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01RjGw4gA5ZvKrU8MQP6sBgT --- crates/ui-egui/src/dialogs_assembly_tests.rs | 3 ++- crates/ui-egui/src/preselect_tests.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/dialogs_assembly_tests.rs b/crates/ui-egui/src/dialogs_assembly_tests.rs index 0785ca91..083645fe 100644 --- a/crates/ui-egui/src/dialogs_assembly_tests.rs +++ b/crates/ui-egui/src/dialogs_assembly_tests.rs @@ -250,7 +250,8 @@ fn drive_value_takes_the_keyboard() { let screen = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(1600.0, 1000.0)); let frame = |app: &mut SolveApp, events: Vec| { let input = egui::RawInput { screen_rect: Some(screen), events, ..Default::default() }; - ctx.run_ui(input, |ui| crate::dialogs::show(app, ui.ctx())) + // Nothing renders here: drop the frame's texture changes deliberately. + ctx.run_ui(input, |ui| crate::dialogs::show(app, ui.ctx())).textures_delta.clear(); }; frame(&mut app, vec![]); frame(&mut app, vec![]); diff --git a/crates/ui-egui/src/preselect_tests.rs b/crates/ui-egui/src/preselect_tests.rs index 8a79bbb1..f7bbfd89 100644 --- a/crates/ui-egui/src/preselect_tests.rs +++ b/crates/ui-egui/src/preselect_tests.rs @@ -297,7 +297,7 @@ fn boundary_fill_finds_the_cells_and_fills_the_ticked_ones() { app.dialog = Some(d); // The dialog finds the cells on its next frame. let ctx = egui::Context::default(); - let _ = ctx.run_ui(Default::default(), |ui| crate::dialogs::show(&mut app, ui.ctx())); + ctx.run_ui(Default::default(), |ui| crate::dialogs::show(&mut app, ui.ctx())).textures_delta.clear(); let mut d = app.dialog.take().unwrap(); let Kind::BoundaryFill { cells, .. } = &mut d.kind else { panic!() }; // Only A, only B, and both.