From 78742d561514ef5bf3abeb03369040f92a1929d5 Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Wed, 5 Apr 2023 08:52:56 -0700 Subject: [PATCH] Add additional case to range invalidation test co-authored-by: antonio --- crates/editor/src/editor_tests.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/editor/src/editor_tests.rs b/crates/editor/src/editor_tests.rs index 4df29b1ed585cd3b6efdfb652cf9f23f4eeee682..07326cb7dddebad3538051bb6815fcf00b016026 100644 --- a/crates/editor/src/editor_tests.rs +++ b/crates/editor/src/editor_tests.rs @@ -6154,6 +6154,12 @@ async fn test_copilot_completion_invalidation( assert!(!editor.has_active_copilot_suggestion(cx)); assert_eq!(editor.display_text(cx), "one\nthree\n"); assert_eq!(editor.text(cx), "one\nthree\n"); + + // Undoing the deletion restores the suggestion. + editor.undo(&Default::default(), cx); + assert!(editor.has_active_copilot_suggestion(cx)); + assert_eq!(editor.display_text(cx), "one\ntwo.foo()\nthree\n"); + assert_eq!(editor.text(cx), "one\n\nthree\n"); }); }