Skip to content
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

Conversation

hiroppy
Copy link
Member

@hiroppy hiroppy commented Jan 13, 2017

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), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test

@nodejs-github-bot nodejs-github-bot added test Issues and PRs related to the tests. dont-land-on-v7.x labels Jan 13, 2017
@mscdex mscdex added fs Issues and PRs related to the fs subsystem / file system. and removed dont-land-on-v7.x labels Jan 13, 2017
@@ -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;
Copy link
Member

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 |?

Copy link
Member Author

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!

@@ -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);
Copy link
Contributor

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?

Copy link
Member Author

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?

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jasnell
Copy link
Member

jasnell commented Jan 16, 2017

@sam-github does this LGTY now?

@jasnell
Copy link
Member

jasnell commented Jan 16, 2017

jasnell pushed a commit that referenced this pull request Jan 18, 2017
PR-URL: #10780
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@jasnell
Copy link
Member

jasnell commented Jan 18, 2017

Landed in 622b439

@jasnell jasnell closed this Jan 18, 2017
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 18, 2017
PR-URL: nodejs#10780
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@hiroppy hiroppy deleted the feature/add-tests-to-test-fs-open-flags.js branch January 21, 2017 08:10
targos pushed a commit that referenced this pull request Jan 28, 2017
PR-URL: #10780
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@italoacasas italoacasas mentioned this pull request Jan 29, 2017
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 30, 2017
PR-URL: nodejs#10780
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 30, 2017
PR-URL: nodejs#10780
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@jasnell
Copy link
Member

jasnell commented Mar 8, 2017

This will need backport PRs in order to land on v6 or v4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fs Issues and PRs related to the fs subsystem / file system. test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants