-
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: add tests for rs+, sr+ to test-fs-open-flags.js #10780
test: add tests for rs+, sr+ to test-fs-open-flags.js #10780
Conversation
@@ -10,6 +10,7 @@ const O_CREAT = fs.constants.O_CREAT || 0; | |||
const O_EXCL = fs.constants.O_EXCL || 0; | |||
const O_RDONLY = fs.constants.O_RDONLY || 0; | |||
const O_RDWR = fs.constants.O_RDWR || 0; | |||
const O_SYNC = fs.constants.O_SYNC | 0; |
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.
typo? Seems like it should be ||
instead of |
?
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.
Oops... It is a typo. Thanks!
ea9f7f4
to
211358c
Compare
@@ -22,6 +23,8 @@ assert.strictEqual(stringToFlags('w+'), O_TRUNC | O_CREAT | O_RDWR); | |||
assert.strictEqual(stringToFlags('a'), O_APPEND | O_CREAT | O_WRONLY); | |||
assert.strictEqual(stringToFlags('a+'), O_APPEND | O_CREAT | O_RDWR); | |||
|
|||
assert.strictEqual(stringToFlags('rs+'), O_RDWR | O_SYNC); |
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.
please put after r+
, so that the asserts are in documentation order, making it much easier to check that all documented flags are tested.
Also, I notice that your test for sr+
, but that is not documented, but neither are xw
, etc, which are also tested here.
I'll document the combinations, unless you are interested in PRing a doc update as well?
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.
Updated.
I'll update a doc:) Maybe it is here?
211358c
to
103397a
Compare
103397a
to
0d87817
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
@sam-github does this LGTY now? |
PR-URL: #10780 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Landed in 622b439 |
PR-URL: nodejs#10780 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: #10780 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: nodejs#10780 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: nodejs#10780 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This will need backport PRs in order to land on v6 or v4 |
Add the test of line 35, 36.
https://github.com/nodejs/node/blob/master/lib/internal/fs.js#L35
https://github.com/nodejs/node/blob/master/lib/internal/fs.js#L36
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
test