From 0daceffd38e94f38f8af54c68c7310b50dba8c92 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Sun, 7 Aug 2016 13:50:01 -0700 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/8002 Reviewed-By: Anna Henningsen Reviewed-By: Prince John Wesley Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- test/parallel/test-assert-typedarray-deepequal.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-assert-typedarray-deepequal.js b/test/parallel/test-assert-typedarray-deepequal.js index a078e96f8f..24acd81d6a 100644 --- a/test/parallel/test-assert-typedarray-deepequal.js +++ b/test/parallel/test-assert-typedarray-deepequal.js @@ -26,7 +26,10 @@ const equalArrayPairs = [ [new Int16Array([256]), new Uint16Array([256])], [new Float32Array([+0.0]), new Float32Array([-0.0])], [new Float64Array([+0.0]), new Float32Array([-0.0])], - [new Float64Array([+0.0]), new Float64Array([-0.0])] + [new Float64Array([+0.0]), new Float64Array([-0.0])], + [new Uint8Array([1, 2, 3, 4]).subarray(1), new Uint8Array([2, 3, 4])], + [new Uint16Array([1, 2, 3, 4]).subarray(1), new Uint16Array([2, 3, 4])], + [new Uint32Array([1, 2, 3, 4]).subarray(1, 3), new Uint32Array([2, 3])] ]; const notEqualArrayPairs = [