Skip to content

Commit

Permalink
test: add missing assert.deepEqual() test case
Browse files Browse the repository at this point in the history
None of the existing tests checked for the situation where
`assert.deepEqual()` receives two objects that have the same number of
keys but different key names. Therefore, line 242 of `lib/assert.js` was
not being exercised by any tests.

This change adds the missing test case.

PR-URL: #8152
Reviewed-By: jasnell - James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
Trott authored and MylesBorins committed Oct 26, 2016
1 parent eec078c commit 49c4886
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/parallel/test-assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ assert.doesNotThrow(makeBlock(a.deepEqual, new Number(1), {}),
assert.doesNotThrow(makeBlock(a.deepEqual, new Boolean(true), {}),
a.AssertionError);

// same number of keys but different key names
assert.throws(makeBlock(a.deepEqual, {a: 1}, {b: 1}), a.AssertionError);

//deepStrictEqual
assert.doesNotThrow(makeBlock(a.deepStrictEqual, new Date(2000, 3, 14),
new Date(2000, 3, 14)),
Expand Down

0 comments on commit 49c4886

Please sign in to comment.