diff --git a/test/parallel/test-fs-open-flags.js b/test/parallel/test-fs-open-flags.js index 878726580b..ee33806911 100644 --- a/test/parallel/test-fs-open-flags.js +++ b/test/parallel/test-fs-open-flags.js @@ -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; const O_TRUNC = fs.constants.O_TRUNC || 0; const O_WRONLY = fs.constants.O_WRONLY || 0; @@ -17,6 +18,8 @@ const { stringToFlags } = require('internal/fs'); assert.strictEqual(stringToFlags('r'), O_RDONLY); assert.strictEqual(stringToFlags('r+'), O_RDWR); +assert.strictEqual(stringToFlags('rs+'), O_RDWR | O_SYNC); +assert.strictEqual(stringToFlags('sr+'), O_RDWR | O_SYNC); assert.strictEqual(stringToFlags('w'), O_TRUNC | O_CREAT | O_WRONLY); assert.strictEqual(stringToFlags('w+'), O_TRUNC | O_CREAT | O_RDWR); assert.strictEqual(stringToFlags('a'), O_APPEND | O_CREAT | O_WRONLY);