Skip to content

Commit 89be875

Browse files
webzwo0irhansen
authored andcommitted
tests: Add regression tests for #2836
They test if it is possible to delete lines from the array that is mutated by a changeset, and after no line is left insert some characters (with or without new lines).
1 parent 0c31940 commit 89be875

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/node/easysync_tests.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,17 @@ const runTests = () => {
217217
['skip', 1, 1, true],
218218
], ['banana\n', 'cabbage\n', 'duffle\n']);
219219

220+
// #2836 regressions
221+
runMutationTest(8, ['\n'], [
222+
['remove', 1, 1, '\n'],
223+
['insert', 'c', 0],
224+
], ['c']);
225+
runMutationTest(9, ['\n'], [
226+
['remove', 1, 1, '\n'],
227+
['insert', 'a'],
228+
['insert', 'c\n', 1],
229+
], ['ac\n']);
230+
220231
const poolOrArray = (attribs) => {
221232
if (attribs.getAttrib) {
222233
return attribs; // it's already an attrib pool

0 commit comments

Comments
 (0)