-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: testing noAssert in buffer.write() #10790
Conversation
You should be able to run these tests for those functions as well. The issue with those functions will only manifest if you request something out of range. Since this test requests valid ranges with |
b174d57
to
16573ab
Compare
@Trott included those test cases |
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 if CI is green
|
||
assert.throws( | ||
() => Buffer.alloc(-1)[funx](0), | ||
/^RangeError: "size" argument must not be negative$/ |
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.
This functionality is tested every time. Wouldn't it be enough to test this only once?
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.
Oh, yes, that's testing the wrong thing. It should test a legit alloc() call and an out-of-range call to the write function being tested. @larissayvette can you adjust it?
16573ab
to
1c69e01
Compare
Changes LGTM |
Single failure on SmartOS is unrelated, opened an issue for it. |
Add test to cover previously untested `noAssert` functionality in buf.write*() functions. PR-URL: nodejs#10790 Reviewed-By: Rich Trott <[email protected]>
Landed in 084acc8. |
Add test to cover previously untested `noAssert` functionality in buf.write*() functions. PR-URL: #10790 Reviewed-By: Rich Trott <[email protected]>
Add test to cover previously untested `noAssert` functionality in buf.write*() functions. PR-URL: #10790 Reviewed-By: Rich Trott <[email protected]>
This would need a backport PR to land in v4 |
Add test to cover previously untested `noAssert` functionality in buf.write*() functions. PR-URL: #10790 Reviewed-By: Rich Trott <[email protected]>
Checklist
Affected core subsystem(s)
test
Test for
noAssert
in buffer.write() files and inludedbuffer.writeDouble*
andbuffer.writeFloat*
as it was not present in the first commit