Skip to content

Commit

Permalink
util: add regression tests
Browse files Browse the repository at this point in the history
This makes sure util.isDate and util.isRegExp will not abort in case
more than one argument is passed to the utility function.
  • Loading branch information
BridgeAR committed Mar 7, 2018
1 parent b5825e1 commit ba94410
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ assert.strictEqual(false, util.isArray(Object.create(Array.prototype)));

// isRegExp
assert.strictEqual(true, util.isRegExp(/regexp/));
assert.strictEqual(true, util.isRegExp(RegExp()));
assert.strictEqual(true, util.isRegExp(RegExp(), 'foo'));
assert.strictEqual(true, util.isRegExp(new RegExp()));
assert.strictEqual(true, util.isRegExp(context('RegExp')()));
assert.strictEqual(false, util.isRegExp({}));
Expand All @@ -52,7 +52,7 @@ assert.strictEqual(false, util.isRegExp(Object.create(RegExp.prototype)));

// isDate
assert.strictEqual(true, util.isDate(new Date()));
assert.strictEqual(true, util.isDate(new Date(0)));
assert.strictEqual(true, util.isDate(new Date(0), 'foo'));
assert.strictEqual(true, util.isDate(new (context('Date'))()));
assert.strictEqual(false, util.isDate(Date()));
assert.strictEqual(false, util.isDate({}));
Expand Down

0 comments on commit ba94410

Please sign in to comment.