summaryrefslogtreecommitdiff
path: root/test/parallel/test-fs-open-numeric-flags.js
diff options
context:
space:
mode:
authorCarl Lei <xecycle@gmail.com>2015-11-03 09:52:46 +0800
committerBen Noordhuis <info@bnoordhuis.nl>2015-11-22 13:35:02 +0100
commit804cc7670d9474ea6bb7d7b4e109de7d0adbd72f (patch)
tree6ef27cb8835c5357c77ec14855d94151aae9d9bd /test/parallel/test-fs-open-numeric-flags.js
parent3f4409e5717f26460d01213217cacf6f33a69bfc (diff)
downloadandroid-node-v8-804cc7670d9474ea6bb7d7b4e109de7d0adbd72f.tar.gz
android-node-v8-804cc7670d9474ea6bb7d7b4e109de7d0adbd72f.tar.bz2
android-node-v8-804cc7670d9474ea6bb7d7b4e109de7d0adbd72f.zip
test: numeric flags to fs.open
This has been supperted for long but never tested nor documented. PR-URL: https://github.com/nodejs/node/pull/3641 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/parallel/test-fs-open-numeric-flags.js')
-rw-r--r--test/parallel/test-fs-open-numeric-flags.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/parallel/test-fs-open-numeric-flags.js b/test/parallel/test-fs-open-numeric-flags.js
new file mode 100644
index 0000000000..d3bd42227c
--- /dev/null
+++ b/test/parallel/test-fs-open-numeric-flags.js
@@ -0,0 +1,16 @@
+'use strict';
+const common = require('../common');
+
+const constants = require('constants');
+const assert = require('assert');
+const fs = require('fs');
+const path = require('path');
+
+common.refreshTmpDir();
+
+// O_WRONLY without O_CREAT shall fail with ENOENT
+const pathNE = path.join(common.tmpDir, 'file-should-not-exist');
+assert.throws(
+ () => fs.openSync(pathNE, constants.O_WRONLY),
+ (e) => e.code === 'ENOENT'
+);