Skip to content

Commit

Permalink
test: improve coverage of stream.Readable
Browse files Browse the repository at this point in the history
PR-URL: #38702
Refs: https://coverage.nodejs.org/coverage-0996eb71edbd47d9/lib/internal/streams/readable.js.html#L401
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Daijiro Wachi <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
  • Loading branch information
pd4d10 authored and targos committed Sep 4, 2021
1 parent 526e6c7 commit f13a302
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/parallel/test-streams-highwatermark.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,16 @@ const { inspect } = require('util');
readable._read = common.mustCall();
readable.read(0);
}

{
// Parse size as decimal integer
['1', '1.0', 1].forEach((size) => {
const readable = new stream.Readable({
read: common.mustCall(),
highWaterMark: 0,
});
readable.read(size);

assert.strictEqual(readable._readableState.highWaterMark, Number(size));
});
}

0 comments on commit f13a302

Please sign in to comment.