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>
This commit is contained in:
parent
8bb60e3c8d
commit
a5aa7c1713
@ -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…
x
Reference in New Issue
Block a user