Browse Source

test: expand test case for unknown file open flags

PR-URL: https://github.com/nodejs/node/pull/5590
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
process-exit-stdio-flushing
James M Snell 9 years ago
parent
commit
a5aa7c1713
  1. 15
      test/parallel/test-fs-open-flags.js

15
test/parallel/test-fs-open-flags.js

@ -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/
);

Loading…
Cancel
Save