From 49c488625d54018fd199ae3a24f1a2fdb250bbb5 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 17 Aug 2016 16:57:47 -0700 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/8152 Reviewed-By: jasnell - James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig --- test/parallel/test-assert.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index 9d53420f00faae..01945b223d67f8 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -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)),