mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 16:07:46 +00:00
LibJS: Add Uint8ClampedArray to TypedArray tests
This commit is contained in:
parent
3faeabf1dc
commit
8244d7916e
18 changed files with 20 additions and 1 deletions
|
@ -1,5 +1,6 @@
|
|||
test("basic functionality", () => {
|
||||
expect(Uint8Array.BYTES_PER_ELEMENT).toBe(1);
|
||||
expect(Uint8ClampedArray.BYTES_PER_ELEMENT).toBe(1);
|
||||
expect(Uint16Array.BYTES_PER_ELEMENT).toBe(2);
|
||||
expect(Uint32Array.BYTES_PER_ELEMENT).toBe(4);
|
||||
expect(BigUint64Array.BYTES_PER_ELEMENT).toBe(8);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const TYPED_ARRAYS = [
|
||||
Uint8Array,
|
||||
Uint8ClampedArray,
|
||||
Uint16Array,
|
||||
Uint32Array,
|
||||
Int8Array,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const TYPED_ARRAYS = [
|
||||
Uint8Array,
|
||||
Uint8ClampedArray,
|
||||
Uint16Array,
|
||||
Uint32Array,
|
||||
Int8Array,
|
||||
|
@ -176,6 +177,7 @@ test("typed array from TypedArray element cast", () => {
|
|||
|
||||
const u32Expected = [
|
||||
[0, 0xff],
|
||||
[0xff, 0xff],
|
||||
[0x100, 0xff],
|
||||
[0x100, 0xff],
|
||||
[0, -1],
|
||||
|
@ -184,7 +186,7 @@ test("typed array from TypedArray element cast", () => {
|
|||
[0x100, 0xff],
|
||||
[0x100, 0xff],
|
||||
];
|
||||
const u8Expected = [0xff, 0xff, 0xff, -1, 0xff, 0xff, 0xff, 0xff];
|
||||
const u8Expected = [0xff, 0xff, 0xff, 0xff, -1, 0xff, 0xff, 0xff, 0xff];
|
||||
|
||||
TYPED_ARRAYS.forEach((T, i) => {
|
||||
const newArrFromU32 = new T(u32Array);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const TYPED_ARRAYS = [
|
||||
Uint8Array,
|
||||
Uint8ClampedArray,
|
||||
Uint16Array,
|
||||
Uint32Array,
|
||||
Int8Array,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const TYPED_ARRAYS = [
|
||||
{ array: Uint8Array, expected: 1 },
|
||||
{ array: Uint8ClampedArray, expected: 1 },
|
||||
{ array: Uint16Array, expected: 2 },
|
||||
{ array: Uint32Array, expected: 4 },
|
||||
{ array: BigUint64Array, expected: 8 },
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const TYPED_ARRAYS = [
|
||||
Uint8Array,
|
||||
Uint8ClampedArray,
|
||||
Uint16Array,
|
||||
Uint32Array,
|
||||
Int8Array,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const TYPED_ARRAYS = [
|
||||
Uint8Array,
|
||||
Uint8ClampedArray,
|
||||
Uint16Array,
|
||||
Uint32Array,
|
||||
BigUint64Array,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const TYPED_ARRAYS = [
|
||||
{ array: Uint8Array, expected: 3 },
|
||||
{ array: Uint8ClampedArray, expected: 3 },
|
||||
{ array: Uint16Array, expected: 6 },
|
||||
{ array: Uint32Array, expected: 12 },
|
||||
{ array: BigUint64Array, expected: 24 },
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const TYPED_ARRAYS = [
|
||||
Uint8Array,
|
||||
Uint8ClampedArray,
|
||||
Uint16Array,
|
||||
Uint32Array,
|
||||
BigUint64Array,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const TYPED_ARRAYS = [
|
||||
Uint8Array,
|
||||
Uint8ClampedArray,
|
||||
Uint16Array,
|
||||
Uint32Array,
|
||||
Int8Array,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const TYPED_ARRAYS = [
|
||||
Uint8Array,
|
||||
Uint8ClampedArray,
|
||||
Uint16Array,
|
||||
Uint32Array,
|
||||
Int8Array,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const TYPED_ARRAYS = [
|
||||
Uint8Array,
|
||||
Uint8ClampedArray,
|
||||
Uint16Array,
|
||||
Uint32Array,
|
||||
Int8Array,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const TYPED_ARRAYS = [
|
||||
Uint8Array,
|
||||
Uint8ClampedArray,
|
||||
Uint16Array,
|
||||
Uint32Array,
|
||||
Int8Array,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const TYPED_ARRAYS = [
|
||||
Uint8Array,
|
||||
Uint8ClampedArray,
|
||||
Uint16Array,
|
||||
Uint32Array,
|
||||
Int8Array,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const TYPED_ARRAYS = [
|
||||
Uint8Array,
|
||||
Uint8ClampedArray,
|
||||
Uint16Array,
|
||||
Uint32Array,
|
||||
Int8Array,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const TYPED_ARRAYS = [
|
||||
Uint8Array,
|
||||
Uint8ClampedArray,
|
||||
Uint16Array,
|
||||
Uint32Array,
|
||||
BigUint64Array,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const TYPED_ARRAYS = [
|
||||
Uint8Array,
|
||||
Uint8ClampedArray,
|
||||
Uint16Array,
|
||||
Uint32Array,
|
||||
Int8Array,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
const TYPED_ARRAYS = [
|
||||
Uint8Array,
|
||||
Uint8ClampedArray,
|
||||
Uint16Array,
|
||||
Uint32Array,
|
||||
Int8Array,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue