Path: blob/main/src/vs/editor/test/browser/controller/cursor.integrationTest.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import assert from 'assert';6import { Selection } from '../../../common/core/selection.js';7import { withTestCodeEditor } from '../testCodeEditor.js';89suite('Editor Controller', () => {1011test('issue #23913: Greater than 1000+ multi cursor typing replacement text appears inverted, lines begin to drop off selection', function () {12this.timeout(10000);13const LINE_CNT = 2000;1415const text: string[] = [];16for (let i = 0; i < LINE_CNT; i++) {17text[i] = 'asd';18}1920withTestCodeEditor(text, {}, (editor, viewModel) => {21const model = editor.getModel();2223const selections: Selection[] = [];24for (let i = 0; i < LINE_CNT; i++) {25selections[i] = new Selection(i + 1, 1, i + 1, 1);26}27viewModel.setSelections('test', selections);2829viewModel.type('n', 'keyboard');30viewModel.type('n', 'keyboard');3132for (let i = 0; i < LINE_CNT; i++) {33assert.strictEqual(model.getLineContent(i + 1), 'nnasd', 'line #' + (i + 1));34}3536assert.strictEqual(viewModel.getSelections().length, LINE_CNT);37assert.strictEqual(viewModel.getSelections()[LINE_CNT - 1].startLineNumber, LINE_CNT);38});39});40});414243