From 3e236af3e78191aacf9daa86dfe69aead91a9a09 Mon Sep 17 00:00:00 2001 From: Martin Ball Date: Sat, 7 Nov 2026 18:42:39 +0000 Subject: [PATCH] =?UTF-8?q?#1537:=20review=20=E2=80=94=20the=20text-only?= =?UTF-8?q?=20paste=20test=20checks=20the=20destination's=20own=20formatti?= =?UTF-8?q?ng=20stays=20(CodeRabbit)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/tests.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/ui-egui/src/tests.rs b/crates/ui-egui/src/tests.rs index 689b8e0d2c..040bca1485 100644 --- a/crates/ui-egui/src/tests.rs +++ b/crates/ui-egui/src/tests.rs @@ -4166,6 +4166,8 @@ fn ctrl_shift_v_without_copied_formatting_pastes_text_only() { a.run("format.bold", json!({})).unwrap(); a.run("edit.copy", json!({})).unwrap(); a.run("select.text", json!({"text": "plain"})).unwrap(); + // The destination has formatting of its own, so a paste that dropped it would show. + a.run("format.italic", json!({})).unwrap(); assert!(a.session.painter.is_none()); let mut h = harness(a); h.run_steps(6); @@ -4175,6 +4177,8 @@ fn ctrl_shift_v_without_copied_formatting_pastes_text_only() { assert_eq!(body_text(h.state()), "Bold Bold", "the clipboard text replaced the selection"); let bold = h.state_mut().run("format.state", json!({})).unwrap().get("bold").and_then(Value::as_bool); assert_ne!(bold, Some(true), "the pasted text took the destination's formatting, not the copied bold"); + let italic = h.state_mut().run("format.state", json!({})).unwrap().get("italic").and_then(Value::as_bool); + assert_eq!(italic, Some(true), "the pasted text kept the destination's italic"); } /// #1669: with Shift held, Backspace still erases (#707) and Delete cuts the selection, doing