Path: blob/main/src/vs/editor/test/common/model/editStack.test.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 { ensureNoDisposablesAreLeakedInTestSuite } from '../../../../base/test/common/utils.js';7import { Selection } from '../../../common/core/selection.js';8import { TextChange } from '../../../common/core/textChange.js';9import { EndOfLineSequence } from '../../../common/model.js';10import { SingleModelEditStackData } from '../../../common/model/editStack.js';1112suite('EditStack', () => {1314ensureNoDisposablesAreLeakedInTestSuite();1516test('issue #118041: unicode character undo bug', () => {17const stackData = new SingleModelEditStackData(181,192,20EndOfLineSequence.LF,21EndOfLineSequence.LF,22[new Selection(10, 2, 10, 2)],23[new Selection(10, 1, 10, 1)],24[new TextChange(428, '', 428, '')]25);2627const buff = stackData.serialize();28const actual = SingleModelEditStackData.deserialize(buff);2930assert.deepStrictEqual(actual, stackData);31});3233});343536