Fix vim tests using old key bindings

This commit is contained in:
Antonio Scandurra 2022-07-27 12:19:01 +02:00
parent 6a718dc4da
commit f0814c7784
4 changed files with 25 additions and 25 deletions

View file

@ -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(
"|",

View file

@ -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

View file

@ -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

View file

@ -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