Skip to content

Commit 622b439

Browse files
hiroppyjasnell
authored andcommitted
test: add tests for rs+, sr+ to test-fs-open-flags.js
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]>
1 parent ef1e77d commit 622b439

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/parallel/test-fs-open-flags.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@ const O_CREAT = fs.constants.O_CREAT || 0;
1010
const O_EXCL = fs.constants.O_EXCL || 0;
1111
const O_RDONLY = fs.constants.O_RDONLY || 0;
1212
const O_RDWR = fs.constants.O_RDWR || 0;
13+
const O_SYNC = fs.constants.O_SYNC || 0;
1314
const O_TRUNC = fs.constants.O_TRUNC || 0;
1415
const O_WRONLY = fs.constants.O_WRONLY || 0;
1516

1617
const { stringToFlags } = require('internal/fs');
1718

1819
assert.strictEqual(stringToFlags('r'), O_RDONLY);
1920
assert.strictEqual(stringToFlags('r+'), O_RDWR);
21+
assert.strictEqual(stringToFlags('rs+'), O_RDWR | O_SYNC);
22+
assert.strictEqual(stringToFlags('sr+'), O_RDWR | O_SYNC);
2023
assert.strictEqual(stringToFlags('w'), O_TRUNC | O_CREAT | O_WRONLY);
2124
assert.strictEqual(stringToFlags('w+'), O_TRUNC | O_CREAT | O_RDWR);
2225
assert.strictEqual(stringToFlags('a'), O_APPEND | O_CREAT | O_WRONLY);

0 commit comments

Comments
 (0)