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 <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
XeCycle authored and Myles Borins committed Nov 30, 2015
1 parent 41453b3 commit 0482ec4
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions 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'
);

0 comments on commit 0482ec4

Please sign in to comment.