Skip to content

Commit a5aa7c1

Browse files
committed
test: expand test case for unknown file open flags
PR-URL: #5590 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Myles Borins <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
1 parent 8bb60e3 commit a5aa7c1

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

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

+15
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,18 @@ assert.equal(fs._stringToFlags('xa+'), O_APPEND | O_CREAT | O_RDWR | O_EXCL);
3434
.forEach(function(flags) {
3535
assert.throws(function() { fs._stringToFlags(flags); });
3636
});
37+
38+
assert.throws(
39+
() => fs._stringToFlags({}),
40+
/Unknown file open flag: \[object Object\]/
41+
);
42+
43+
assert.throws(
44+
() => fs._stringToFlags(true),
45+
/Unknown file open flag: true/
46+
);
47+
48+
assert.throws(
49+
() => fs._stringToFlags(null),
50+
/Unknown file open flag: null/
51+
);

0 commit comments

Comments
 (0)