Skip to content

Commit

Permalink
test: numeric flags to fs.open
Browse files Browse the repository at this point in the history
This has been supperted for long but never tested nor documented.

PR-URL: #3641
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
XeCycle authored and rvagg committed Dec 5, 2015
1 parent f4ca007 commit f9fe0ae
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/parallel/test-fs-open-numeric-flags.js
Original file line number Diff line number Diff line change
@@ -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'
);

0 comments on commit f9fe0ae

Please sign in to comment.