-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Streams: add tests for ReadableStreamBYOBReader.read(view, { min }) #29723
Streams: add tests for ReadableStreamBYOBReader.read(view, { min }) #29723
Conversation
assert_equals(pullCount, 2, 'pull() must only be called 2 times'); | ||
assert_false(result3.done, 'branch2 second read() should not be done'); | ||
assert_typed_array_equals(result3.value, new Uint8Array([0x02, 0x03]), 'branch2 second read() value'); | ||
}, 'ReadableStream with byte source: tee() with readFully() from branch1 and read() from branch2'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment on whatwg/streams#1145 for context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All tests LGTM, be also need tests for the early-error cases, e.g. detached buffer, 0-length view/buffer, etc.
Maybe run the coverage tool and see what it spits out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I can't see any obvious gaps. Just a few nits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Added a couple more tests, coverage should be good now. 🙂 |
Still lgtm. |
ce4e332
to
86ab381
Compare
060a1ab
to
a684ebd
Compare
a684ebd
to
3de5344
Compare
Still lgtm. |
29f52ee
to
e9fb817
Compare
Add tests for the new optional
min
parameter inReadableStreamBYOBReader.read(view, { min })
.See whatwg/streams#1145 for the accompanying spec change.
To do:
0 < min <= view.length