-
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: error when empty buffer is passed to filehandle.read() #23250
test: error when empty buffer is passed to filehandle.read() #23250
Conversation
@@ -26,3 +27,14 @@ assert.throws( | |||
'Received Uint8Array []' | |||
} | |||
); | |||
|
|||
fsPromises.open(filepath, 'r').then((filehandle) => { |
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: if we could write this with await
it would look better.
@@ -26,3 +27,14 @@ assert.throws( | |||
'Received Uint8Array []' | |||
} | |||
); | |||
|
|||
fsPromises.open(filepath, 'r').then((filehandle) => { |
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.
Also, now that you are doing it, please cover the fs promises read with a file descriptor.
{ | ||
code: 'ERR_INVALID_ARG_VALUE', | ||
message: 'The argument \'buffer\' is empty and cannot be written. ' + | ||
'Received Uint8Array []' |
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: I think this needs to be aligned with 'The argument...
61d6bef
to
a93f6e0
Compare
a93f6e0
to
3b01a5e
Compare
@danbev Thank you for your comment. I updated the commit message. |
Added tests to occur error when empty buffer is passed to filehandle.read() to increase coverage.
3b01a5e
to
41afe00
Compare
Re-run of failing node-test-commit-linux-containered ✔️ |
@danbev Thank you to tell me that this should be rebased and to run CI. |
Landed in a8530bc. |
Added tests to occur error when empty buffer is passed to filehandle.read() to increase coverage. PR-URL: #23250 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
Added tests to occur error when empty buffer is passed to filehandle.read() to increase coverage. PR-URL: #23250 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
Added tests to occur error when empty buffer is passed to
filehandle.read()
to increase coverage.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes