From 00620d8771d3ea70709927a9b8340f1982d820de Mon Sep 17 00:00:00 2001 From: hetmankp Date: Wed, 24 Jul 2019 15:45:53 +1000 Subject: [PATCH] Added tests for gk and gj motions --- test/mode/modeVisual.test.ts | 16 ++++++++++++++++ test/mode/modeVisualLine.test.ts | 16 ++++++++++++++++ test/mode/normalModeTests/motions.test.ts | 14 ++++++++++++++ 3 files changed, 46 insertions(+) diff --git a/test/mode/modeVisual.test.ts b/test/mode/modeVisual.test.ts index 354bf9baa898..0fe26e2355ae 100644 --- a/test/mode/modeVisual.test.ts +++ b/test/mode/modeVisual.test.ts @@ -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", diff --git a/test/mode/modeVisualLine.test.ts b/test/mode/modeVisualLine.test.ts index 25c09ece1245..ba83d065c02d 100644 --- a/test/mode/modeVisualLine.test.ts +++ b/test/mode/modeVisualLine.test.ts @@ -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', diff --git a/test/mode/normalModeTests/motions.test.ts b/test/mode/normalModeTests/motions.test.ts index 5f2f2afe075a..f34fdc462635 100644 --- a/test/mode/normalModeTests/motions.test.ts +++ b/test/mode/normalModeTests/motions.test.ts @@ -669,4 +669,18 @@ suite('Motions in Normal Mode', () => { keysPressed: '', 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'], + }); });