From bdacd76af0d25c2bfd4827bd73f4c8e529fce749 Mon Sep 17 00:00:00 2001 From: Khawar Zamman Wani Date: Fri, 20 Nov 2026 12:29:57 +0530 Subject: [PATCH] Object Selection gear tests: the boxed app and the borrows of the new update signature --- crates/ui-egui/src/tools/object_selection_gear_tests.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/ui-egui/src/tools/object_selection_gear_tests.rs b/crates/ui-egui/src/tools/object_selection_gear_tests.rs index bf3d0906987..72cf230ecf7 100644 --- a/crates/ui-egui/src/tools/object_selection_gear_tests.rs +++ b/crates/ui-egui/src/tools/object_selection_gear_tests.rs @@ -11,7 +11,7 @@ use crate::state::{ObjectFinderMode, Tool, ToolOptions}; const DISC: [f64; 2] = [100.0, 80.0]; /// A 200 x 160 document: a red disc (centre 100,80, radius 45) on blue, nothing selected. -fn app(mode: ObjectFinderMode) -> PhotocraftApp { +fn app(mode: ObjectFinderMode) -> Box { let mut app = PhotocraftApp::new(photocraft_engine::Session::new(), crate::Services::default()); app.run("file.new", json!({"width": 200, "height": 160})).unwrap(); app.sync_views(); @@ -85,7 +85,8 @@ fn reset_tool_restores_them() { fn assert_idle(app: &mut PhotocraftApp) { let u = hover(app, DISC); assert!(u.shown.is_none() && !u.busy); - let u = update(app, Some(DISC), false, 500.0, &app.ctx().clone()); + let ctx = app.ctx().clone(); + let u = update(app, Some(DISC), false, 500.0, &ctx); assert!(u.shown.is_none() && !u.busy); } @@ -129,7 +130,8 @@ fn manual_refresh_survives_selection_changes_and_leaving() { let mut app = app(ObjectFinderMode::Manual); refresh(&mut app); assert!(hover(&mut app, DISC).shown.is_some()); - assert!(update(&mut app, None, false, 200.0, &app.ctx().clone()).shown.is_none()); + let ctx = app.ctx().clone(); + assert!(update(&mut app, None, false, 200.0, &ctx).shown.is_none()); app.run("select.all", json!({})).unwrap(); app.run("select.deselect", json!({})).unwrap(); assert!(hover(&mut app, DISC).shown.is_some());