-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Improvements to test-buffer-slice from NINA code & learn #10048
Conversation
- change implicit string equal() compares to strictEqual compares of buffer output (the slice output default) - explicitly create buffers from utf8 inputs for the compare -
- change implicit string equal() compares to strictEqual compares of buffer output (the slice output default) - explicitly create buffers from utf8 inputs for the 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.
LGTM
assert.strictEqual(0, Buffer.from('hello').slice(0, 0).length); | ||
assert.strictEqual(0, Buffer('hello').slice(0, 0).length); | ||
assert.strictEqual(0, Buffer.from('hello', 'utf8').slice(0, 0).length); | ||
assert.strictEqual(0, Buffer('hello', 'utf8').slice(0, 0).length); |
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: adding 'utf8'
to these is unnecessary since that is the default already.
* change implicit string equal() compares to strictEqual compares of buffer output (the slice output default) * explicitly create buffers from utf8 inputs for the compare PR-URL: #10048 Reviewed-By: James M Snell <jasnell@gmail.com>
Landedin 02a4c08. thank you for the PR and for participating in the code-and-learn! |
* change implicit string equal() compares to strictEqual compares of buffer output (the slice output default) * explicitly create buffers from utf8 inputs for the compare PR-URL: #10048 Reviewed-By: James M Snell <jasnell@gmail.com>
* change implicit string equal() compares to strictEqual compares of buffer output (the slice output default) * explicitly create buffers from utf8 inputs for the compare PR-URL: nodejs#10048 Reviewed-By: James M Snell <jasnell@gmail.com>
* change implicit string equal() compares to strictEqual compares of buffer output (the slice output default) * explicitly create buffers from utf8 inputs for the compare PR-URL: nodejs#10048 Reviewed-By: James M Snell <jasnell@gmail.com>
* change implicit string equal() compares to strictEqual compares of buffer output (the slice output default) * explicitly create buffers from utf8 inputs for the compare PR-URL: #10048 Reviewed-By: James M Snell <jasnell@gmail.com>
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesAffected core subsystem(s)
Description of change