Skip to content

Commit

Permalink
Visual/VisualLine tests for keys I and A (VSCodeVim#2167)
Browse files Browse the repository at this point in the history
  • Loading branch information
shawn-pe committed Aug 26, 2018
1 parent e38d400 commit 5096f98
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 0 deletions.
46 changes: 46 additions & 0 deletions test/mode/modeVisual.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1176,4 +1176,50 @@ suite('Mode Visual', () => {
assertEqual(selection.end.line, 2);
});
});

suite('can prepend text with I', () => {
newTest({
title: 'multiline insert from bottom up selection',
start: ['111', '222', '333', '4|44', '555'],
keysPressed: 'vkkI_',
end: ['111', '2_|22', '_333', '_444', '555'],
});

newTest({
title: 'multiline insert from top down selection',
start: ['111', '2|22', '333', '444', '555'],
keysPressed: 'vjjI_',
end: ['111', '2_|22', '_333', '_444', '555'],
});

newTest({
title: 'skips blank lines',
start: ['111', '2|22', ' ', '444', '555'],
keysPressed: 'vjjI_',
end: ['111', '2_|22', ' ', '_444', '555'],
});
});

suite('can append text with A', () => {
newTest({
title: 'multiline append from bottom up selection',
start: ['111', '222', '333', '4|44', '555'],
keysPressed: 'vkkA_',
end: ['111', '222_|', '333_', '44_4', '555'],
});

newTest({
title: 'multiline append from top down selection',
start: ['111', '2|22', '333', '444', '555'],
keysPressed: 'vjjA_',
end: ['111', '222_|', '333_', '44_4', '555'],
});

newTest({
title: 'skips blank lines',
start: ['111', '2|22', ' ', '444', '555'],
keysPressed: 'vjjA_',
end: ['111', '222_|', ' ', '44_4', '555'],
});
});
});
46 changes: 46 additions & 0 deletions test/mode/modeVisualLine.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,4 +436,50 @@ suite('Mode Visual Line', () => {
assertEqual(selection.end.line, 1);
});
});

suite('can prepend text with I', () => {
newTest({
title: 'multiline insert from bottom up selection',
start: ['111', '222', '333', '4|44', '555'],
keysPressed: 'VkkI_',
end: ['111', '_|222', '_333', '_444', '555'],
});

newTest({
title: 'multiline insert from top down selection',
start: ['111', '2|22', '333', '444', '555'],
keysPressed: 'VjjI_',
end: ['111', '_|222', '_333', '_444', '555'],
});

newTest({
title: 'skips blank lines',
start: ['111', '2|22', ' ', '444', '555'],
keysPressed: 'VjjI_',
end: ['111', '_|222', ' ', '_444', '555'],
});
});

suite('can append text with A', () => {
newTest({
title: 'multiline append from bottom up selection',
start: ['111', '222', '333', '4|44', '555'],
keysPressed: 'VkkA_',
end: ['111', '222_|', '333_', '444_', '555'],
});

newTest({
title: 'multiline append from top down selection',
start: ['111', '2|22', '333', '444', '555'],
keysPressed: 'VjjA_',
end: ['111', '222_|', '333_', '444_', '555'],
});

newTest({
title: 'skips blank lines',
start: ['111', '2|22', ' ', '444', '555'],
keysPressed: 'VjjA_',
end: ['111', '222_|', ' ', '444_', '555'],
});
});
});

0 comments on commit 5096f98

Please sign in to comment.