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 more assertions for joining lines at the end of the file

Nathan Sobo61352f68ea36
diff --git a/crates/editor/src/editor_tests.rs b/crates/editor/src/editor_tests.rs
index d11ddb53249..27ea26f7882 100644
--- a/crates/editor/src/editor_tests.rs
+++ b/crates/editor/src/editor_tests.rs
@@ -2376,6 +2376,20 @@ fn test_join_lines(cx: &mut TestAppContext) {
[Point::new(2, 3)..Point::new(2, 3)]
);
+ editor.join_lines(&JoinLines, cx);
+ assert_eq!(buffer.read(cx).text(), "aaa bbb\nccc\nddd");
+ assert_eq!(
+ editor.selections.ranges::<Point>(cx),
+ [Point::new(2, 3)..Point::new(2, 3)]
+ );
+
+ editor.join_lines(&JoinLines, cx);
+ assert_eq!(buffer.read(cx).text(), "aaa bbb\nccc\nddd");
+ assert_eq!(
+ editor.selections.ranges::<Point>(cx),
+ [Point::new(2, 3)..Point::new(2, 3)]
+ );
+
editor
});
}