mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-25 18:06:15 -04:00
Changeset: Migrate from mergingOpAssembler()
to squashOps()
This commit is contained in:
parent
daa6b9074a
commit
2448fb8e41
4 changed files with 63 additions and 58 deletions
|
@ -129,16 +129,17 @@ describe('easysync-other', function () {
|
|||
describe('split/join attribution lines', function () {
|
||||
const testSplitJoinAttributionLines = (randomSeed) => {
|
||||
const stringToOps = (str) => {
|
||||
const assem = Changeset.mergingOpAssembler();
|
||||
const o = new Changeset.Op('+');
|
||||
o.chars = 1;
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
const c = str.charAt(i);
|
||||
o.lines = (c === '\n' ? 1 : 0);
|
||||
o.attribs = (c === 'a' || c === 'b' ? `*${c}` : '');
|
||||
assem.append(o);
|
||||
}
|
||||
return assem.toString();
|
||||
const ops = (function* () {
|
||||
for (let i = 0; i < str.length; i++) {
|
||||
const c = str.charAt(i);
|
||||
const o = new Changeset.Op('+');
|
||||
o.chars = 1;
|
||||
o.lines = (c === '\n' ? 1 : 0);
|
||||
o.attribs = (c === 'a' || c === 'b' ? `*${c}` : '');
|
||||
yield o;
|
||||
}
|
||||
})();
|
||||
return Changeset.serializeOps(Changeset.squashOps(ops, false));
|
||||
};
|
||||
|
||||
it(`testSplitJoinAttributionLines#${randomSeed}`, async function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue