SQL Operations Studio Public Preview 1 (0.23) release source code

This commit is contained in:
Karl Burtram
2017-11-09 14:30:27 -08:00
parent b88ecb8d93
commit 3cdac41339
8829 changed files with 759707 additions and 286 deletions

View File

@@ -0,0 +1,70 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import { Selection } from 'vs/editor/common/core/selection';
import { MoveCaretCommand } from 'vs/editor/contrib/caretOperations/common/moveCaretCommand';
import { testCommand } from 'vs/editor/test/common/commands/commandTestUtils';
function testMoveCaretLeftCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void {
testCommand(lines, null, selection, (sel) => new MoveCaretCommand(sel, true), expectedLines, expectedSelection);
}
function testMoveCaretRightCommand(lines: string[], selection: Selection, expectedLines: string[], expectedSelection: Selection): void {
testCommand(lines, null, selection, (sel) => new MoveCaretCommand(sel, false), expectedLines, expectedSelection);
}
suite('Editor Contrib - Move Caret Command', () => {
test('move selection to left', function () {
testMoveCaretLeftCommand(
[
'012345'
],
new Selection(1, 3, 1, 5),
[
'023145'
],
new Selection(1, 2, 1, 4)
);
});
test('move selection to right', function () {
testMoveCaretRightCommand(
[
'012345'
],
new Selection(1, 3, 1, 5),
[
'014235'
],
new Selection(1, 4, 1, 6)
);
});
test('move selection to left - from first column - no change', function () {
testMoveCaretLeftCommand(
[
'012345'
],
new Selection(1, 1, 1, 1),
[
'012345'
],
new Selection(1, 1, 1, 1)
);
});
test('move selection to right - from last column - no change', function () {
testMoveCaretRightCommand(
[
'012345'
],
new Selection(1, 5, 1, 7),
[
'012345'
],
new Selection(1, 5, 1, 7)
);
});
});