From 3cd9833effed7e5cfbb32ccf19d42e714e01b488 Mon Sep 17 00:00:00 2001 From: abouthiroppy Date: Fri, 13 Jan 2017 09:34:24 +0900 Subject: [PATCH] test: add tests for rs+, sr+ to test-fs-open-flags.js PR-URL: https://github.com/nodejs/node/pull/10780 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Sam Roberts Reviewed-By: Michael Dawson --- test/parallel/test-fs-open-flags.js | 3 +++ 1 file changed, 3 insertions(+) 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);