From 1e2492b4d6474ac3cbe9e96382f9e003413b80cb Mon Sep 17 00:00:00 2001 From: prxnvt <53838599+prxnvt@users.noreply.github.com> Date: Sat, 24 Oct 2026 02:36:54 -0400 Subject: [PATCH] Tests: the large-macro editor test reads the UI clock Clippy refuses std::time::Instant::now, which traps on wasm; the test that bounds the step list's frame time reads gridcraft_ui_egui::now_ms instead. --- crates/ui-egui/tests/it/macro_editor.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/tests/it/macro_editor.rs b/crates/ui-egui/tests/it/macro_editor.rs index d08a8d641..91abbd397 100644 --- a/crates/ui-egui/tests/it/macro_editor.rs +++ b/crates/ui-egui/tests/it/macro_editor.rs @@ -542,8 +542,9 @@ fn a_macro_at_the_step_limit_opens_without_freezing_the_editor() { h.run_steps(2); // Each row used to copy the whole list: five frames took about a minute. Now well under a // second; the bound leaves room for a slow machine. - let t = std::time::Instant::now(); + let t = gridcraft_ui_egui::now_ms(); h.run_steps(5); - assert!(t.elapsed() < std::time::Duration::from_secs(10), "five frames took {:?}", t.elapsed()); + let ms = gridcraft_ui_egui::now_ms() - t; + assert!(ms < 10_000.0, "five frames took {ms} ms"); assert!(h.query_by_label_contains("Step 1: ").is_some()); }