Skip to content

Commit

Permalink
add tests to validate TypedArray class differences
Browse files Browse the repository at this point in the history
  • Loading branch information
planttheidea committed Feb 27, 2023
1 parent 2922af3 commit c14b38e
Showing 1 changed file with 72 additions and 1 deletion.
73 changes: 72 additions & 1 deletion __tests__/__helpers__/testSuites.js
Original file line number Diff line number Diff line change
Expand Up @@ -625,6 +625,14 @@ export default [
value1: new Float32Array([21, 31]),
value2: new Float32Array([31, 21]),
},
{
deepEqual: false,
description:
'not equal Float32Array objects (different TypedArray class)',
shallowEqual: false,
value1: new Float32Array([21, 31]),
value2: new Float64Array([21, 31]),
},
{
deepEqual: true,
description: 'equal Float64Array objects',
Expand All @@ -634,11 +642,19 @@ export default [
},
{
deepEqual: false,
description: 'not equal Float32Array objects (different value)',
description: 'not equal Float64Array objects (different value)',
shallowEqual: false,
value1: new Float64Array([21, 31]),
value2: new Float64Array([31, 21]),
},
{
deepEqual: false,
description:
'not equal Float64Array objects (different TypedArray class)',
shallowEqual: false,
value1: new Float64Array([21, 31]),
value2: new Int8Array([21, 31]),
},
{
deepEqual: true,
description: 'equal Int8Array objects',
Expand All @@ -653,6 +669,13 @@ export default [
value1: new Int8Array([21, 31]),
value2: new Int8Array([31, 21]),
},
{
deepEqual: false,
description: 'not equal Int8Array objects (different TypedArray class)',
shallowEqual: false,
value1: new Int8Array([21, 31]),
value2: new Int16Array([21, 31]),
},
{
deepEqual: true,
description: 'equal Int16Array objects',
Expand All @@ -667,6 +690,14 @@ export default [
value1: new Int16Array([21, 31]),
value2: new Int16Array([31, 21]),
},
{
deepEqual: false,
description:
'not equal Int16Array objects (different TypedArray class)',
shallowEqual: false,
value1: new Int16Array([21, 31]),
value2: new Int32Array([21, 31]),
},
{
deepEqual: true,
description: 'equal Int32Array objects',
Expand All @@ -681,6 +712,14 @@ export default [
value1: new Int32Array([21, 31]),
value2: new Int32Array([31, 21]),
},
{
deepEqual: false,
description:
'not equal Int32Array objects (different TypedArray class)',
shallowEqual: false,
value1: new Int32Array([21, 31]),
value2: new Uint8Array([21, 31]),
},
{
deepEqual: true,
description: 'equal Uint8Array objects',
Expand All @@ -695,6 +734,14 @@ export default [
value1: new Uint8Array([21, 31]),
value2: new Uint8Array([31, 21]),
},
{
deepEqual: false,
description:
'not equal Uint8Array objects (different TypedArray class)',
shallowEqual: false,
value1: new Uint8Array([21, 31]),
value2: new Uint8ClampedArray([21, 31]),
},
{
deepEqual: true,
description: 'equal Uint8ClampedArray objects',
Expand All @@ -709,6 +756,14 @@ export default [
value1: new Uint8ClampedArray([21, 31]),
value2: new Uint8ClampedArray([31, 21]),
},
{
deepEqual: false,
description:
'not equal Uint8ClampedArray objects (different TypedArray class)',
shallowEqual: false,
value1: new Uint8ClampedArray([21, 31]),
value2: new Uint16Array([21, 31]),
},
{
deepEqual: true,
description: 'equal Uint16Array objects',
Expand All @@ -723,6 +778,14 @@ export default [
value1: new Uint16Array([21, 31]),
value2: new Uint16Array([31, 21]),
},
{
deepEqual: false,
description:
'not equal Uint16Array objects (different TypedArray class)',
shallowEqual: false,
value1: new Uint16Array([21, 31]),
value2: new Uint32Array([21, 31]),
},
{
deepEqual: true,
description: 'equal Uint32Array objects',
Expand All @@ -737,6 +800,14 @@ export default [
value1: new Uint32Array([21, 31]),
value2: new Uint32Array([31, 21]),
},
{
deepEqual: false,
description:
'not equal Uint32Array objects (different TypedArray class)',
shallowEqual: false,
value1: new Uint32Array([21, 31]),
value2: new Float32Array([21, 31]),
},
],
},
{
Expand Down

0 comments on commit c14b38e

Please sign in to comment.