Skip to content

Commit a041b61

Browse files
fb55qnighy
andcommitted
Add test case
Fixes #357 Co-Authored-By: Masaki Hara <[email protected]>
1 parent f9462d3 commit a041b61

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

packages/parse5-html-rewriting-stream/test/rewriting-stream.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,4 +305,22 @@ describe('RewritingStream', () => {
305305

306306
assert.throws(() => stream.write(buf), TypeError);
307307
});
308+
309+
it('Regression - RewritingStream - should pass long text correctly (GH-292)', (done) => {
310+
const source = 'a'.repeat(65_540);
311+
const parser = new RewritingStream();
312+
let output = '';
313+
314+
parser.on('data', (data) => {
315+
output += data.toString();
316+
});
317+
318+
parser.once('finish', () => {
319+
assert.strictEqual(output.length, source.length);
320+
done();
321+
});
322+
323+
parser.write(source);
324+
parser.end();
325+
});
308326
});

0 commit comments

Comments
 (0)