From f0814c7784cb32bfc62a42149ff1d0399c89f88a Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 27 Jul 2022 12:19:01 +0200 Subject: [PATCH] Fix vim tests using old key bindings --- crates/vim/src/normal.rs | 22 +++++++++++----------- crates/vim/src/normal/change.rs | 10 +++++----- crates/vim/src/normal/delete.rs | 10 +++++----- crates/vim/src/visual.rs | 8 ++++---- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/crates/vim/src/normal.rs b/crates/vim/src/normal.rs index 65909702ba..9ece9605b7 100644 --- a/crates/vim/src/normal.rs +++ b/crates/vim/src/normal.rs @@ -427,7 +427,7 @@ mod test { #[gpui::test] async fn test_jump_to_line_boundaries(cx: &mut gpui::TestAppContext) { let cx = VimTestContext::new(cx, true).await; - let mut cx = cx.binding(["shift-$"]); + let mut cx = cx.binding(["$"]); cx.assert("T|est test", "Test tes|t"); cx.assert("Test tes|t", "Test tes|t"); cx.assert( @@ -471,7 +471,7 @@ mod test { #[gpui::test] async fn test_jump_to_end(cx: &mut gpui::TestAppContext) { let cx = VimTestContext::new(cx, true).await; - let mut cx = cx.binding(["shift-G"]); + let mut cx = cx.binding(["shift-g"]); cx.assert( indoc! {" @@ -561,7 +561,7 @@ mod test { ); for cursor_offset in cursor_offsets { - cx.simulate_keystroke("shift-W"); + cx.simulate_keystroke("shift-w"); cx.assert_editor_selections(vec![Selection::from_offset(cursor_offset)]); } } @@ -607,7 +607,7 @@ mod test { Mode::Normal, ); for cursor_offset in cursor_offsets { - cx.simulate_keystroke("shift-E"); + cx.simulate_keystroke("shift-e"); cx.assert_editor_selections(vec![Selection::from_offset(cursor_offset)]); } } @@ -653,7 +653,7 @@ mod test { Mode::Normal, ); for cursor_offset in cursor_offsets.into_iter().rev() { - cx.simulate_keystroke("shift-B"); + cx.simulate_keystroke("shift-b"); cx.assert_editor_selections(vec![Selection::from_offset(cursor_offset)]); } } @@ -740,7 +740,7 @@ mod test { #[gpui::test] async fn test_insert_end_of_line(cx: &mut gpui::TestAppContext) { let cx = VimTestContext::new(cx, true).await; - let mut cx = cx.binding(["shift-A"]).mode_after(Mode::Insert); + let mut cx = cx.binding(["shift-a"]).mode_after(Mode::Insert); cx.assert("The q|uick", "The quick|"); cx.assert("The q|uick ", "The quick |"); cx.assert("|", "|"); @@ -765,7 +765,7 @@ mod test { #[gpui::test] async fn test_jump_to_first_non_whitespace(cx: &mut gpui::TestAppContext) { let cx = VimTestContext::new(cx, true).await; - let mut cx = cx.binding(["shift-^"]); + let mut cx = cx.binding(["^"]); cx.assert("The q|uick", "|The quick"); cx.assert(" The q|uick", " |The quick"); cx.assert("|", "|"); @@ -792,7 +792,7 @@ mod test { #[gpui::test] async fn test_insert_first_non_whitespace(cx: &mut gpui::TestAppContext) { let cx = VimTestContext::new(cx, true).await; - let mut cx = cx.binding(["shift-I"]).mode_after(Mode::Insert); + let mut cx = cx.binding(["shift-i"]).mode_after(Mode::Insert); cx.assert("The q|uick", "|The quick"); cx.assert(" The q|uick", " |The quick"); cx.assert("|", "|"); @@ -817,7 +817,7 @@ mod test { #[gpui::test] async fn test_delete_to_end_of_line(cx: &mut gpui::TestAppContext) { let cx = VimTestContext::new(cx, true).await; - let mut cx = cx.binding(["shift-D"]); + let mut cx = cx.binding(["shift-d"]); cx.assert( indoc! {" The q|uick @@ -858,7 +858,7 @@ mod test { #[gpui::test] async fn test_delete_left(cx: &mut gpui::TestAppContext) { let cx = VimTestContext::new(cx, true).await; - let mut cx = cx.binding(["shift-X"]); + let mut cx = cx.binding(["shift-x"]); cx.assert("Te|st", "T|st"); cx.assert("T|est", "|est"); cx.assert("|Test", "|Test"); @@ -956,7 +956,7 @@ mod test { #[gpui::test] async fn test_insert_line_above(cx: &mut gpui::TestAppContext) { let cx = VimTestContext::new(cx, true).await; - let mut cx = cx.binding(["shift-O"]).mode_after(Mode::Insert); + let mut cx = cx.binding(["shift-o"]).mode_after(Mode::Insert); cx.assert( "|", diff --git a/crates/vim/src/normal/change.rs b/crates/vim/src/normal/change.rs index 55445c930e..03f213b584 100644 --- a/crates/vim/src/normal/change.rs +++ b/crates/vim/src/normal/change.rs @@ -139,7 +139,7 @@ mod test { test"}, ); - let mut cx = cx.binding(["c", "shift-W"]); + let mut cx = cx.binding(["c", "shift-w"]); cx.assert("Test te|st-test test", "Test te| test"); } @@ -174,7 +174,7 @@ mod test { test"}, ); - let mut cx = cx.binding(["c", "shift-E"]); + let mut cx = cx.binding(["c", "shift-e"]); cx.assert("Test te|st-test test", "Test te| test"); } @@ -204,14 +204,14 @@ mod test { test"}, ); - let mut cx = cx.binding(["c", "shift-B"]); + let mut cx = cx.binding(["c", "shift-b"]); cx.assert("Test test-test |test", "Test |test"); } #[gpui::test] async fn test_change_end_of_line(cx: &mut gpui::TestAppContext) { let cx = VimTestContext::new(cx, true).await; - let mut cx = cx.binding(["c", "shift-$"]).mode_after(Mode::Insert); + let mut cx = cx.binding(["c", "$"]).mode_after(Mode::Insert); cx.assert( indoc! {" The q|uick @@ -347,7 +347,7 @@ mod test { #[gpui::test] async fn test_change_end_of_document(cx: &mut gpui::TestAppContext) { let cx = VimTestContext::new(cx, true).await; - let mut cx = cx.binding(["c", "shift-G"]).mode_after(Mode::Insert); + let mut cx = cx.binding(["c", "shift-g"]).mode_after(Mode::Insert); cx.assert( indoc! {" The quick diff --git a/crates/vim/src/normal/delete.rs b/crates/vim/src/normal/delete.rs index c5c823c79e..ca2c27cf70 100644 --- a/crates/vim/src/normal/delete.rs +++ b/crates/vim/src/normal/delete.rs @@ -109,7 +109,7 @@ mod test { test"}, ); - let mut cx = cx.binding(["d", "shift-W"]); + let mut cx = cx.binding(["d", "shift-w"]); cx.assert("Test te|st-test test", "Test te|test"); } @@ -144,7 +144,7 @@ mod test { test"}, ); - let mut cx = cx.binding(["d", "shift-E"]); + let mut cx = cx.binding(["d", "shift-e"]); cx.assert("Test te|st-test test", "Test te| test"); } @@ -176,14 +176,14 @@ mod test { test"}, ); - let mut cx = cx.binding(["d", "shift-B"]); + let mut cx = cx.binding(["d", "shift-b"]); cx.assert("Test test-test |test", "Test |test"); } #[gpui::test] async fn test_delete_end_of_line(cx: &mut gpui::TestAppContext) { let cx = VimTestContext::new(cx, true).await; - let mut cx = cx.binding(["d", "shift-$"]); + let mut cx = cx.binding(["d", "$"]); cx.assert( indoc! {" The q|uick @@ -304,7 +304,7 @@ mod test { #[gpui::test] async fn test_delete_end_of_document(cx: &mut gpui::TestAppContext) { let cx = VimTestContext::new(cx, true).await; - let mut cx = cx.binding(["d", "shift-G"]); + let mut cx = cx.binding(["d", "shift-g"]); cx.assert( indoc! {" The quick diff --git a/crates/vim/src/visual.rs b/crates/vim/src/visual.rs index fedb999cad..02fcdabd09 100644 --- a/crates/vim/src/visual.rs +++ b/crates/vim/src/visual.rs @@ -422,7 +422,7 @@ mod test { #[gpui::test] async fn test_visual_line_delete(cx: &mut gpui::TestAppContext) { let cx = VimTestContext::new(cx, true).await; - let mut cx = cx.binding(["shift-V", "x"]); + let mut cx = cx.binding(["shift-v", "x"]); cx.assert( indoc! {" The qu|ick brown @@ -457,7 +457,7 @@ mod test { The quick brown fox ju|mps over"}, ); - let mut cx = cx.binding(["shift-V", "j", "x"]); + let mut cx = cx.binding(["shift-v", "j", "x"]); cx.assert( indoc! {" The qu|ick brown @@ -558,7 +558,7 @@ mod test { #[gpui::test] async fn test_visual_line_change(cx: &mut gpui::TestAppContext) { let cx = VimTestContext::new(cx, true).await; - let mut cx = cx.binding(["shift-V", "c"]).mode_after(Mode::Insert); + let mut cx = cx.binding(["shift-v", "c"]).mode_after(Mode::Insert); cx.assert( indoc! {" The qu|ick brown @@ -597,7 +597,7 @@ mod test { fox jumps over |"}, ); - let mut cx = cx.binding(["shift-V", "j", "c"]).mode_after(Mode::Insert); + let mut cx = cx.binding(["shift-v", "j", "c"]).mode_after(Mode::Insert); cx.assert( indoc! {" The qu|ick brown