-
Notifications
You must be signed in to change notification settings - Fork 30.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
test: fix buffer alloc tests #9998
Conversation
@@ -1027,7 +1027,8 @@ assert(Buffer.allocUnsafe(1).parent instanceof ArrayBuffer); | |||
Buffer.poolSize = ps; | |||
|
|||
// Test Buffer.copy() segfault | |||
assert.throws(() => Buffer.allocUnsafe(10).copy()); | |||
assert.throws(() => Buffer.allocUnsafe(10).copy(), | |||
/TypeError: argument should be a Buffer/); |
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.
Can you line this up with the beginning of the arrow function on the previous line. Also, if you're validating the entire error message, you can add ^
and $
to the regular expression.
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.
Lined up with arrow function. I did not match for start of string and end of string since error message that I saw were lengthy and contained much more to the string thats in validation.
Replaced assert.equal to assert.strictEqual. Fixed assert.throws syntax and added second argument
68d9696
to
2426521
Compare
Replaced assert.equal to assert.strictEqual. Fixed assert.throws syntax and added second argument PR-URL: #9998 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Landed in ee97f84. thank you for the PR and for participating in the code-and-learn! |
Replaced assert.equal to assert.strictEqual. Fixed assert.throws syntax and added second argument PR-URL: #9998 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Replaced assert.equal to assert.strictEqual. Fixed assert.throws syntax and added second argument PR-URL: nodejs#9998 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Replaced assert.equal to assert.strictEqual. Fixed assert.throws syntax and added second argument PR-URL: nodejs#9998 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Replaced assert.equal to assert.strictEqual. Fixed assert.throws syntax and added second argument PR-URL: #9998 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
Description of change
Replaced assert.equal to assert.strictEqual.
Fixed assert.throws syntax and added second argument to assert.throws