From 61352f68ea36f02576148b1c29580ce167fc9887 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Wed, 21 Jun 2023 11:21:09 -0600 Subject: [PATCH] Add more assertions for joining lines at the end of the file Co-Authored-By: Conrad Irwin --- crates/editor/src/editor_tests.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crates/editor/src/editor_tests.rs b/crates/editor/src/editor_tests.rs index d11ddb5324..27ea26f788 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::(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::(cx), + [Point::new(2, 3)..Point::new(2, 3)] + ); + editor }); }