Skip to content

Commit a8438a0

Browse files
ferossjasnell
authored andcommitted
test,assert: add deepEqual/deepStrictEqual tests for typed arrays
Let's test typed arrays which have a .byteOffset and .byteLength (i.e. typed arrays that are slices of parent typed arrays). PR-URL: #8002 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Prince John Wesley <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 387ab62 commit a8438a0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/parallel/test-assert-typedarray-deepequal.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ const equalArrayPairs = [
2626
[new Int16Array([256]), new Uint16Array([256])],
2727
[new Float32Array([+0.0]), new Float32Array([-0.0])],
2828
[new Float64Array([+0.0]), new Float32Array([-0.0])],
29-
[new Float64Array([+0.0]), new Float64Array([-0.0])]
29+
[new Float64Array([+0.0]), new Float64Array([-0.0])],
30+
[new Uint8Array([1, 2, 3, 4]).subarray(1), new Uint8Array([2, 3, 4])],
31+
[new Uint16Array([1, 2, 3, 4]).subarray(1), new Uint16Array([2, 3, 4])],
32+
[new Uint32Array([1, 2, 3, 4]).subarray(1, 3), new Uint32Array([2, 3])]
3033
];
3134

3235
const notEqualArrayPairs = [

0 commit comments

Comments
 (0)