summaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-open-flags.js
diff options
context:
space:
mode:
authorabouthiroppy <git@about-hiroppy.com>2017-01-13 09:34:24 +0900
committerJames M Snell <jasnell@gmail.com>2017-01-18 08:53:54 -0800
commit622b43997f4f9f5204c337a8028d964eddf31d00 (patch)
treee464c68513304a240302059f522c198f18417d6d /test/parallel/test-fs-open-flags.js
parentef1e77d186c021539731e8279eb68e2c7aae0a21 (diff)
downloadandroid-node-v8-622b43997f4f9f5204c337a8028d964eddf31d00.tar.gz
android-node-v8-622b43997f4f9f5204c337a8028d964eddf31d00.tar.bz2
android-node-v8-622b43997f4f9f5204c337a8028d964eddf31d00.zip
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 <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'test/parallel/test-fs-open-flags.js')
-rw-r--r--test/parallel/test-fs-open-flags.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/parallel/test-fs-open-flags.js b/test/parallel/test-fs-open-flags.js
index bc1b3e4ed1..87f6b3b546 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);