Skip to content

Commit

Permalink
Added tests for gk and gj motions
Browse files Browse the repository at this point in the history
  • Loading branch information
hetmankp committed Jul 24, 2019
1 parent e14d23d commit 00620d8
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/mode/modeVisual.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,22 @@ suite('Mode Visual', () => {
});
});

suite('Various motions in Visual Mode', () => {
newTest({
title: "Can handle 'gk'",
start: ['blah', 'duh', '|dur', 'hur'],
keysPressed: 'vgkx',
end: ['blah', '|ur', 'hur'],
});

newTest({
title: "Can handle 'gj'",
start: ['blah', 'duh', '|dur', 'hur'],
keysPressed: 'vgjx',
end: ['blah', 'duh', '|ur'],
});
});

suite('handles aw in visual mode', () => {
newTest({
title: "Can handle 'vawd' on word with cursor inside spaces",
Expand Down
16 changes: 16 additions & 0 deletions test/mode/modeVisualLine.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,22 @@ suite('Mode Visual Line', () => {
});
});

suite('Various motions in Visual Mode', () => {
newTest({
title: "Can handle 'gk'",
start: ['blah', 'duh', '|dur', 'hur'],
keysPressed: 'Vgkx',
end: ['blah', '|hur'],
});

newTest({
title: "Can handle 'gj'",
start: ['blah', 'duh', '|dur', 'hur'],
keysPressed: 'Vgjx',
end: ['blah', '|duh'],
});
});

suite('Can handle d/c correctly in Visual Line Mode', () => {
newTest({
title: 'Can handle d key',
Expand Down
14 changes: 14 additions & 0 deletions test/mode/normalModeTests/motions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -669,4 +669,18 @@ suite('Motions in Normal Mode', () => {
keysPressed: '<right>',
end: ['blah', 'duh', 'd|ur', 'hur'],
});

newTest({
title: "Can handle 'gk'",
start: ['blah', 'duh', '|dur', 'hur'],
keysPressed: 'gk',
end: ['blah', '|duh', 'dur', 'hur'],
});

newTest({
title: "Can handle 'gj'",
start: ['blah', 'duh', '|dur', 'hur'],
keysPressed: 'gj',
end: ['blah', 'duh', 'dur', '|hur'],
});
});

0 comments on commit 00620d8

Please sign in to comment.