Skip to content

Commit 265108a

Browse files
webzwo0irhansen
authored andcommitted
easysync: add clear method to stringAssembler
1 parent d8d6ca2 commit 265108a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/static/js/Changeset.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ exports.stringAssembler = () => ({
579579
* @param {string} x -
580580
*/
581581
append(x) { this._str += String(x); },
582+
clear() { this._str = ''; },
582583
toString() { return this._str; },
583584
});
584585

src/tests/frontend/specs/easysync-assembler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ describe('easysync', function () {
170170
expect(assem.toString()).to.equal('*3*4*5|3+f*1*4*5|1+1*1*4*5+4');
171171
});
172172

173-
xit('smartOpAssembler clear should empty internal assemblers', async function () {
173+
it('smartOpAssembler clear should empty internal assemblers', async function () {
174174
const x = '-c*3*4+6|3=az*asdf0*1*2*3+1=1-1+1*0+1=1-1+1|c=c-1';
175175
const iter = Changeset.opIterator(x);
176176
const assem = Changeset.smartOpAssembler();

0 commit comments

Comments
 (0)