Skip to content

Commit 804cc76

Browse files
XeCyclebnoordhuis
authored andcommitted
test: numeric flags to fs.open
This has been supperted for long but never tested nor documented. PR-URL: #3641 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 3f4409e commit 804cc76

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
'use strict';
2+
constcommon=require('../common');
3+
4+
constconstants=require('constants');
5+
constassert=require('assert');
6+
constfs=require('fs');
7+
constpath=require('path');
8+
9+
common.refreshTmpDir();
10+
11+
// O_WRONLY without O_CREAT shall fail with ENOENT
12+
constpathNE=path.join(common.tmpDir,'file-should-not-exist');
13+
assert.throws(
14+
()=>fs.openSync(pathNE,constants.O_WRONLY),
15+
(e)=>e.code==='ENOENT'
16+
);

0 commit comments

Comments
 (0)