Skip to content

Commit

Permalink
Add test case
Browse files Browse the repository at this point in the history
Fixes #357

Co-Authored-By: Masaki Hara <[email protected]>
  • Loading branch information
fb55 and qnighy committed Mar 3, 2022
1 parent f9462d3 commit a041b61
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,4 +305,22 @@ describe('RewritingStream', () => {

assert.throws(() => stream.write(buf), TypeError);
});

it('Regression - RewritingStream - should pass long text correctly (GH-292)', (done) => {
const source = 'a'.repeat(65_540);
const parser = new RewritingStream();
let output = '';

parser.on('data', (data) => {
output += data.toString();
});

parser.once('finish', () => {
assert.strictEqual(output.length, source.length);
done();
});

parser.write(source);
parser.end();
});
});

0 comments on commit a041b61

Please sign in to comment.