Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Add additional case to range invalidation test

Mikayla Maki78742d561514
diff --git a/crates/editor/src/editor_tests.rs b/crates/editor/src/editor_tests.rs
index 4df29b1ed58..07326cb7ddd 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");
});
}