vim test redux (#11709)

This cleans up the neovim-backed vim tests:
- removed exempted tests (we'll rely on bug reports to find missing edge
cases)
- moved all assertions into non-async fn's so that failures are
reporting on the right file/line
- removed the NeovimBackedBindingTestContext
- renamed a few things to make them clearer
- reduced the number of permutations tested in some cases to reduce
slowest test from 60s to 5s

Release Notes:

- N/A
This commit is contained in:
Conrad Irwin 2024-05-11 12:04:05 -06:00 committed by GitHub
parent 48cba328f2
commit f550f23b97
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
38 changed files with 2311 additions and 6505 deletions

View file

@ -170,25 +170,25 @@ mod test {
cx.update_editor(|editor, cx| {
assert_eq!(editor.snapshot(cx).scroll_position(), point(0., 0.))
});
cx.simulate_keystrokes(["ctrl-e"]);
cx.simulate_keystrokes("ctrl-e");
cx.update_editor(|editor, cx| {
assert_eq!(editor.snapshot(cx).scroll_position(), point(0., 1.))
});
cx.simulate_keystrokes(["2", "ctrl-e"]);
cx.simulate_keystrokes("2 ctrl-e");
cx.update_editor(|editor, cx| {
assert_eq!(editor.snapshot(cx).scroll_position(), point(0., 3.))
});
cx.simulate_keystrokes(["ctrl-y"]);
cx.simulate_keystrokes("ctrl-y");
cx.update_editor(|editor, cx| {
assert_eq!(editor.snapshot(cx).scroll_position(), point(0., 2.))
});
// does not select in normal mode
cx.simulate_keystrokes(["g", "g"]);
cx.simulate_keystrokes("g g");
cx.update_editor(|editor, cx| {
assert_eq!(editor.snapshot(cx).scroll_position(), point(0., 0.))
});
cx.simulate_keystrokes(["ctrl-d"]);
cx.simulate_keystrokes("ctrl-d");
cx.update_editor(|editor, cx| {
assert_eq!(editor.snapshot(cx).scroll_position(), point(0., 3.0));
assert_eq!(
@ -198,11 +198,11 @@ mod test {
});
// does select in visual mode
cx.simulate_keystrokes(["g", "g"]);
cx.simulate_keystrokes("g g");
cx.update_editor(|editor, cx| {
assert_eq!(editor.snapshot(cx).scroll_position(), point(0., 0.))
});
cx.simulate_keystrokes(["v", "ctrl-d"]);
cx.simulate_keystrokes("v ctrl-d");
cx.update_editor(|editor, cx| {
assert_eq!(editor.snapshot(cx).scroll_position(), point(0., 3.0));
assert_eq!(
@ -234,18 +234,18 @@ mod test {
// skip over the scrolloff at the top
// test ctrl-d
cx.simulate_shared_keystrokes(["4", "j", "ctrl-d"]).await;
cx.assert_state_matches().await;
cx.simulate_shared_keystrokes(["ctrl-d"]).await;
cx.assert_state_matches().await;
cx.simulate_shared_keystrokes(["g", "g", "ctrl-d"]).await;
cx.assert_state_matches().await;
cx.simulate_shared_keystrokes("4 j ctrl-d").await;
cx.shared_state().await.assert_matches();
cx.simulate_shared_keystrokes("ctrl-d").await;
cx.shared_state().await.assert_matches();
cx.simulate_shared_keystrokes("g g ctrl-d").await;
cx.shared_state().await.assert_matches();
// test ctrl-u
cx.simulate_shared_keystrokes(["ctrl-u"]).await;
cx.assert_state_matches().await;
cx.simulate_shared_keystrokes(["ctrl-d", "ctrl-d", "4", "j", "ctrl-u", "ctrl-u"])
cx.simulate_shared_keystrokes("ctrl-u").await;
cx.shared_state().await.assert_matches();
cx.simulate_shared_keystrokes("ctrl-d ctrl-d 4 j ctrl-u ctrl-u")
.await;
cx.assert_state_matches().await;
cx.shared_state().await.assert_matches();
}
}