mirror of
https://github.com/nodejs/node.git
synced 2026-11-26 21:58:26 -05:00
assert: make partialDeepStrictEqual throw when comparing [0] with [-0]
Fixes: https://github.com/nodejs/node/issues/56230 PR-URL: https://github.com/nodejs/node/pull/56237 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: LiviaMedeiros <livia@cirno.name> Reviewed-By: Xuguang Mei <meixuguang@gmail.com> Reviewed-By: Jordan Harband <ljharb@gmail.com>
This commit is contained in:
1 parent
20ace0bb01
commit
7b4d288116
2 files changed
+100
-19
No files matched your search
@@ -97,6 +97,41 @@ describe('Object Comparison Tests', () => {
|
||||
actual: [1, 'two', true],
|
||||
expected: [1, 'two', false],
|
||||
},
|
||||
{
|
||||
description: 'throws when comparing [0] with [-0]',
|
||||
actual: [0],
|
||||
expected: [-0],
|
||||
},
|
||||
{
|
||||
description: 'throws when comparing [0, 0, 0] with [0, -0]',
|
||||
actual: [0, 0, 0],
|
||||
expected: [0, -0],
|
||||
},
|
||||
{
|
||||
description: 'throws when comparing ["-0"] with [-0]',
|
||||
actual: ['-0'],
|
||||
expected: [-0],
|
||||
},
|
||||
{
|
||||
description: 'throws when comparing [-0] with [0]',
|
||||
actual: [-0],
|
||||
expected: [0],
|
||||
},
|
||||
{
|
||||
description: 'throws when comparing [-0] with ["-0"]',
|
||||
actual: [-0],
|
||||
expected: ['-0'],
|
||||
},
|
||||
{
|
||||
description: 'throws when comparing ["0"] with [0]',
|
||||
actual: ['0'],
|
||||
expected: [0],
|
||||
},
|
||||
{
|
||||
description: 'throws when comparing [0] with ["0"]',
|
||||
actual: [0],
|
||||
expected: ['0'],
|
||||
},
|
||||
{
|
||||
description:
|
||||
'throws when comparing two Date objects with different times',
|
||||
@@ -385,6 +420,21 @@ describe('Object Comparison Tests', () => {
|
||||
actual: [1, 'two', true],
|
||||
expected: [1, 'two', true],
|
||||
},
|
||||
{
|
||||
description: 'compares [0] with [0]',
|
||||
actual: [0],
|
||||
expected: [0],
|
||||
},
|
||||
{
|
||||
description: 'compares [-0] with [-0]',
|
||||
actual: [-0],
|
||||
expected: [-0],
|
||||
},
|
||||
{
|
||||
description: 'compares [0, -0, 0] with [0, 0]',
|
||||
actual: [0, -0, 0],
|
||||
expected: [0, 0],
|
||||
},
|
||||
{
|
||||
description: 'compares two Date objects with the same time',
|
||||
actual: new Date(0),
|
||||
|
||||
Reference in new issue
Block a user