Skip to content

Commit

Permalink
test: expand test case for unknown file open flags
Browse files Browse the repository at this point in the history
PR-URL: #5590
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Myles Borins <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
  • Loading branch information
jasnell committed Mar 9, 2016
1 parent 8bb60e3 commit a5aa7c1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/parallel/test-fs-open-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,18 @@ assert.equal(fs._stringToFlags('xa+'), O_APPEND | O_CREAT | O_RDWR | O_EXCL);
.forEach(function(flags) {
assert.throws(function() { fs._stringToFlags(flags); });
});

assert.throws(
() => fs._stringToFlags({}),
/Unknown file open flag: \[object Object\]/
);

assert.throws(
() => fs._stringToFlags(true),
/Unknown file open flag: true/
);

assert.throws(
() => fs._stringToFlags(null),
/Unknown file open flag: null/
);

0 comments on commit a5aa7c1

Please sign in to comment.