Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test enhancement #938

Merged
merged 3 commits into from
Oct 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions test/mode/modeNormal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1267,4 +1267,12 @@ suite("Mode Normal", () => {
end: ["{", " |"],
endMode: ModeName.Insert
});

newTest({
title: "Indent current line with correct Vim Mode",
start: ["|one", "two"],
keysPressed: ">>",
end: ["\t|one", "two"],
endMode: ModeName.Normal
});
});
2 changes: 1 addition & 1 deletion test/mode/normalModeTests/dot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ suite("Dot Operator", () => {
title: "Can repeat actions that require selections",
start: ['on|e', 'two'],
keysPressed: 'Vj>.',
end: [' |one', ' two']
end: ['\t\t|one', '\t\ttwo']
});
});

Expand Down
17 changes: 14 additions & 3 deletions test/operator/put.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,23 @@

import { ModeHandler } from "../../src/mode/modeHandler";
import { setupWorkspace, cleanUpWorkspace, assertEqualLines } from '../testUtils';
import { getTestingFunctions } from '../testSimplifier';

suite("put operator", () => {

let modeHandler: ModeHandler;
let modeHandler: ModeHandler = new ModeHandler();

let {
newTest,
newTestOnly,
} = getTestingFunctions(modeHandler);

setup(async () => {
await setupWorkspace();

modeHandler = new ModeHandler();
});

suiteTeardown(cleanUpWorkspace);
teardown(cleanUpWorkspace);

test("basic put test", async () => {
await modeHandler.handleMultipleKeyEvents(
Expand Down Expand Up @@ -67,4 +72,10 @@ suite("put operator", () => {
await assertEqualLines(["1", "2", "2", "3"]);
});

newTest({
title: "test yy with correct positon movement",
start: ["o|ne", "two", "three", "four"],
keysPressed: '2yyjjpk',
end: ["one", "two", "|three", "one", "two", "four"]
});
});
4 changes: 4 additions & 0 deletions test/testUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,8 @@ export async function cleanUpWorkspace(): Promise<any> {
export function setTextEditorOptions(tabSize: number, insertSpaces: boolean): void {
Configuration.getInstance().tabstop = tabSize;
Configuration.getInstance().expandtab = insertSpaces;
let options = vscode.window.activeTextEditor.options;
options.tabSize = tabSize;
options.insertSpaces = insertSpaces;
vscode.window.activeTextEditor.options = options;
}