-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
test: increase test coverage of BufferList #10171
Conversation
887e1ea
to
4842402
Compare
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.
Seems ok otherwise, CI: https://ci.nodejs.org/job/node-test-pull-request/5293/
// Flags: --expose_internals | ||
'use strict'; | ||
require('../common'); | ||
var assert = require('assert'); |
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.
Mind to use const
/let
? :D
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.
Thanks for pointing this out. Addressed.
assert.deepStrictEqual(emptyList.concat(0), Buffer.alloc(0)); | ||
|
||
// Test buffer list with one element. | ||
var list = new BufferList(); |
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.
nit const/let
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.
Thanks for pointing this out. Addressed.
|
||
assert.strictEqual(list.join(','), 'foo'); | ||
|
||
var shifted = list.shift(); |
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.
nit const/let
CI: https://ci.nodejs.org/job/node-test-pull-request/5296/ EDIT: Whoops, CI was already run. Sorry for the duplicate. It was ✅ green already... |
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 once it's moved to const
and let
.
Add tests for edges cases of BufferList - test operations when the length is 0 - test operations when the list only has one element
4842402
to
a136e2d
Compare
Thank you for the review, I've updated the |
Landed f0da38a Thanks for the contribution. |
@italoacasas I don’t think this is a problem in this case but try to keep the 48/72 hour rule for landing PRs in mind :) |
Add tests for edges cases of BufferList: - test operations when the length is 0 - test operations when the list only has one element PR-URL: #10171 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Add tests for edges cases of BufferList: - test operations when the length is 0 - test operations when the list only has one element PR-URL: #10171 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Add tests for edges cases of BufferList: - test operations when the length is 0 - test operations when the list only has one element PR-URL: #10171 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Add tests for edges cases of BufferList: - test operations when the length is 0 - test operations when the list only has one element PR-URL: #10171 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
test
Description of change
Add tests for edges cases of BufferList