From a5aa7c17138ba811324526c1178f6a5b4a094acb Mon Sep 17 00:00:00 2001 From: James M Snell Date: Mon, 7 Mar 2016 12:32:54 -0800 Subject: [PATCH] test: expand test case for unknown file open flags PR-URL: https://github.com/nodejs/node/pull/5590 Reviewed-By: Colin Ihrig Reviewed-By: Myles Borins Reviewed-By: Ben Noordhuis --- test/parallel/test-fs-open-flags.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/parallel/test-fs-open-flags.js b/test/parallel/test-fs-open-flags.js index 16b3d35cae..cf451b4f8d 100644 --- a/test/parallel/test-fs-open-flags.js +++ b/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/ +);