diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2018-12-13 07:33:31 +0100 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2019-01-27 03:34:25 +0100 |
commit | 7493db21b667ed746d39c9b54357eac4287232e3 (patch) | |
tree | e6ae60900e43b5fa3d5dcdc8171782ae60192bb1 /test/parallel/test-assert-typedarray-deepequal.js | |
parent | 5cb196441a6df0fc3fa62e042ce108347f49814c (diff) | |
download | android-node-v8-7493db21b667ed746d39c9b54357eac4287232e3.tar.gz android-node-v8-7493db21b667ed746d39c9b54357eac4287232e3.tar.bz2 android-node-v8-7493db21b667ed746d39c9b54357eac4287232e3.zip |
assert: adjust loose assertions
This changes the loose deep equal comparison by using the same logic
as done in the strict deep equal comparison besides comparing
primitives loosely, not comparing symbol properties and not comparing
the prototype.
`assert.deepEqual` is still commenly used and this is likely the
biggest pitfall.
Most changes are only minor and won't have a big impact besides
likely fixing user expectations.
PR-URL: https://github.com/nodejs/node/pull/25008
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Diffstat (limited to 'test/parallel/test-assert-typedarray-deepequal.js')
-rw-r--r-- | test/parallel/test-assert-typedarray-deepequal.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/parallel/test-assert-typedarray-deepequal.js b/test/parallel/test-assert-typedarray-deepequal.js index 1e9c8c8d1c..6be4c10595 100644 --- a/test/parallel/test-assert-typedarray-deepequal.js +++ b/test/parallel/test-assert-typedarray-deepequal.js @@ -29,15 +29,15 @@ const equalArrayPairs = [ ]; const looseEqualArrayPairs = [ - [new Float64Array([+0.0]), new Float32Array([-0.0])], - [new Int16Array(256), new Uint16Array(256)], - [new Int16Array([256]), new Uint16Array([256])], [new Float32Array([+0.0]), new Float32Array([-0.0])], - [new Float64Array([+0.0]), new Float64Array([-0.0])], - [new ArrayBuffer(3), new SharedArrayBuffer(3)] + [new Float64Array([+0.0]), new Float64Array([-0.0])] ]; const notEqualArrayPairs = [ + [new ArrayBuffer(3), new SharedArrayBuffer(3)], + [new Int16Array(256), new Uint16Array(256)], + [new Int16Array([256]), new Uint16Array([256])], + [new Float64Array([+0.0]), new Float32Array([-0.0])], [new Uint8Array(2), new Uint8Array(3)], [new Uint8Array([1, 2, 3]), new Uint8Array([4, 5, 6])], [new Uint8ClampedArray([300, 2, 3]), new Uint8Array([300, 2, 3])], |