From 1d487e19f9902061a07bb490d7e810d05810f34d Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Thu, 20 Apr 2023 16:15:14 +0200 Subject: [PATCH] Fix editor tests Co-Authored-By: Nathan Sobo --- crates/editor/src/editor_tests.rs | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/crates/editor/src/editor_tests.rs b/crates/editor/src/editor_tests.rs index 05b3a17fc7..d339c2aa76 100644 --- a/crates/editor/src/editor_tests.rs +++ b/crates/editor/src/editor_tests.rs @@ -729,21 +729,19 @@ fn test_fold_action(cx: &mut TestAppContext) { #[gpui::test] fn test_move_cursor(cx: &mut TestAppContext) { cx.update(|cx| cx.set_global(Settings::test(cx))); - let (_, view) = cx.add_window(|cx| { - let buffer = MultiBuffer::build_simple(&sample_text(6, 6, 'a'), cx); - buffer.update(cx, |buffer, cx| { - buffer.edit( - vec![ - (Point::new(1, 0)..Point::new(1, 0), "\t"), - (Point::new(1, 1)..Point::new(1, 1), "\t"), - ], - None, - cx, - ); - }); - build_editor(buffer.clone(), cx) - }); + let buffer = cx.update(|cx| MultiBuffer::build_simple(&sample_text(6, 6, 'a'), cx)); + let (_, view) = cx.add_window(|cx| build_editor(buffer.clone(), cx)); + buffer.update(cx, |buffer, cx| { + buffer.edit( + vec![ + (Point::new(1, 0)..Point::new(1, 0), "\t"), + (Point::new(1, 1)..Point::new(1, 1), "\t"), + ], + None, + cx, + ); + }); view.update(cx, |view, cx| { assert_eq!( view.selections.display_ranges(cx), @@ -5848,6 +5846,7 @@ async fn go_to_hunk(deterministic: Arc, cx: &mut gpui::TestAppCon &r#" ˇuse some::modified; + fn main() { println!("hello there"); @@ -5869,6 +5868,7 @@ async fn go_to_hunk(deterministic: Arc, cx: &mut gpui::TestAppCon &r#" use some::modified; + fn main() { ˇ println!("hello there"); @@ -5892,6 +5892,7 @@ async fn go_to_hunk(deterministic: Arc, cx: &mut gpui::TestAppCon &r#" ˇuse some::modified; + fn main() { println!("hello there");