Skip to content

Commit 49c4886

Browse files
TrottMylesBorins
authored andcommitted
test: add missing assert.deepEqual() test case
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 <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent eec078c commit 49c4886

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/parallel/test-assert.js

+3
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ assert.doesNotThrow(makeBlock(a.deepEqual, new Number(1), {}),
164164
assert.doesNotThrow(makeBlock(a.deepEqual, new Boolean(true), {}),
165165
a.AssertionError);
166166

167+
// same number of keys but different key names
168+
assert.throws(makeBlock(a.deepEqual, {a: 1}, {b: 1}), a.AssertionError);
169+
167170
//deepStrictEqual
168171
assert.doesNotThrow(makeBlock(a.deepStrictEqual, new Date(2000, 3, 14),
169172
new Date(2000, 3, 14)),

0 commit comments

Comments
 (0)