From 9f1b8054ba242dcead9a8e2d0cb287c13240c79e Mon Sep 17 00:00:00 2001 From: RickiNano <81099017+RickiNano@users.noreply.github.com> Date: Sat, 21 Nov 2026 08:46:37 +0100 Subject: [PATCH] Check the Erase to History mode flags in the mid-stroke tool-key test (#16041) A dropped pencil or block flag goes from the plain and the switched stroke alike, so the pixel comparisons can't see it; assert the emitted flags, as #16041's mutation list asks. --- crates/ui-egui/src/pencil_tests.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/ui-egui/src/pencil_tests.rs b/crates/ui-egui/src/pencil_tests.rs index 5b79bf4cc2a..e7a4d6551af 100644 --- a/crates/ui-egui/src/pencil_tests.rs +++ b/crates/ui-egui/src/pencil_tests.rs @@ -416,6 +416,10 @@ fn history_stroke_pixels(mode: &str, pressed: &serde_json::Value, switched: Opti tool_event(&mut app, ToolEvent::Up { x: pts[4].0, y: pts[4].1 }, Modifiers::NONE); let (id, p) = last(&app); assert_eq!(id, "paint.historyBrush", "{mode}: {p}"); + // The mode's own flags: the pixel comparisons can't see one go, as both strokes would lose it. + for flag in ["pencil", "block"] { + assert_eq!(p.get(flag) == Some(&json!(true)), mode == flag, "{mode}: {flag} in {p}"); + } let st = app.session.active().unwrap(); layer(&app).surface().unwrap().read_region(st.doc.bounds()) }