Skip to content

Commit

Permalink
test: do not OR F_OK in fs.access() test
Browse files Browse the repository at this point in the history
access() does not support OR'ing F_OK with other constants.
This commit updates test-fs-access.js to not test that
scenario.

PR-URL: nodejs#41484
Refs: libuv/libuv#3410
Reviewed-By: Richard Lau
Reviewed-By: Luigi Pinca
Reviewed-By: Tobias Nießen
  • Loading branch information
cjihrig authored and thedull committed Jan 18, 2022
1 parent bd45334 commit ce547e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/parallel/test-fs-access.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ fs.access(__filename, fs.R_OK, common.mustCall(function(...args) {
fs.promises.access(__filename, fs.R_OK)
.then(common.mustCall())
.catch(throwNextTick);
fs.access(readOnlyFile, fs.F_OK | fs.R_OK, common.mustCall(function(...args) {
fs.access(readOnlyFile, fs.R_OK, common.mustCall(function(...args) {
assert.deepStrictEqual(args, [null]);
}));
fs.promises.access(readOnlyFile, fs.F_OK | fs.R_OK)
fs.promises.access(readOnlyFile, fs.R_OK)
.then(common.mustCall())
.catch(throwNextTick);

Expand Down Expand Up @@ -153,7 +153,7 @@ assert.throws(

// Regular access should not throw.
fs.accessSync(__filename);
const mode = fs.F_OK | fs.R_OK | fs.W_OK;
const mode = fs.R_OK | fs.W_OK;
fs.accessSync(readWriteFile, mode);

// Invalid modes should throw.
Expand Down

0 comments on commit ce547e8

Please sign in to comment.