From 3a69187896169f267579c2d0dee60c14cb30b3d4 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 18 Nov 2026 06:15:41 -0800 Subject: [PATCH] Tests: Cmd+A then Cmd+Shift+= keeps the whole text and makes it superscript The same-frame check now compares the joined run text with the full text as well as checking that every run is superscript, so an empty or shortened result fails. --- crates/ui-egui/src/shortcuts/tests.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/shortcuts/tests.rs b/crates/ui-egui/src/shortcuts/tests.rs index c41bd10c44..5dbdc46a14 100644 --- a/crates/ui-egui/src/shortcuts/tests.rs +++ b/crates/ui-egui/src/shortcuts/tests.rs @@ -1161,7 +1161,11 @@ fn cmd_shift_equals_and_cmd_alt_shift_equals_toggle_superscript_and_subscript() let before = zoom(&mut app); frame(&mut app, [press(Key::A, Modifiers::NONE), press(Key::Equals, shift)].concat()); assert_eq!(zoom(&mut app), before, "no zoom once Select All selected the type"); - assert!(positions(&mut app).iter().all(|(_, p)| *p == json!("superscript")), "{:?}", positions(&mut app)); + // The earlier mixed selection left the text in two runs; check that both lines are still + // there and every run is superscript. + let runs = positions(&mut app); + assert_eq!(runs.iter().filter_map(|(t, _)| t.as_str()).collect::(), "One\nTwo", "{runs:?}"); + assert!(runs.iter().all(|(_, p)| *p == json!("superscript")), "{runs:?}"); } /// Tab shows and hides the panels, and in the Type tool it types a tab, without moving the