Skip to content

Commit 7d3f575

Browse files
thefourtheyeevanlucas
authored andcommitted
test: make sure O_NOATIME is present only in Linux
As it is, the test checks if the return value is `undefined` in other platforms. But it should also make sure that the `O_NOATIME` should be found only in Linux. PR-URL: #6614 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent ce2d5be commit 7d3f575

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

test/parallel/test-process-constants-noatime.js

+8-7
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
require('../common');
44
const assert = require('assert');
5-
6-
const isLinux = process.platform === 'linux';
7-
8-
const O_NOATIME = process.binding('constants').O_NOATIME;
9-
const expected = isLinux ? 0x40000 : undefined;
10-
11-
assert.strictEqual(O_NOATIME, expected);
5+
const constants = process.binding('constants');
6+
7+
if (process.platform === 'linux') {
8+
assert('O_NOATIME' in constants);
9+
assert.strictEqual(constants.O_NOATIME, 0x40000);
10+
} else {
11+
assert(!('O_NOATIME' in constants));
12+
}

0 commit comments

Comments
 (0)