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 <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
  • 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.