-
Notifications
You must be signed in to change notification settings - Fork 274
/
InputIgnoreTest.re
32 lines (26 loc) · 992 Bytes
/
InputIgnoreTest.re
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
open Oni_Core;
open Oni_Model;
open Oni_IntegrationTestLib;
module Log = (val Log.withNamespace("IntegrationTest.inputIgnore"));
// This test validates that certain keystrokes are ignored by our Vim layer
runTest(~name="InputIgnore test", (dispatch, wait, runEffects) => {
wait(~name="Initial mode is normal", (state: State.t) =>
Feature_Vim.mode(state.vim) == Vim.Mode.Normal
);
dispatch(KeyboardInput({isText: true, input: "i"}));
wait(~name="Mode switches to insert", (state: State.t) =>
Feature_Vim.mode(state.vim) == Vim.Mode.Insert
);
dispatch(KeyboardInput({isText: false, input: "<D-A->"}));
dispatch(KeyboardInput({isText: false, input: "b"}));
runEffects();
wait(~name="Buffer is correct", (state: State.t) =>
switch (Selectors.getActiveBuffer(state)) {
| None => false
| Some(buf) =>
let line1 = Buffer.getLine(0, buf) |> BufferLine.raw;
Log.info("Line1 is: " ++ line1 ++ "|");
String.equal(line1, "b");
}
);
});