mirror of https://github.com/tc39/test262.git
Remove redundancy from test for testTypedArray.js
This commit is contained in:
parent
f527a107f2
commit
7c2af2265c
|
@ -10,34 +10,16 @@ description: >
|
|||
testWithTypedArrayConstructors()
|
||||
testTypedArrayConversions()
|
||||
|
||||
includes: [testTypedArray.js,arrayContains.js]
|
||||
includes: [testTypedArray.js]
|
||||
features: [TypedArray]
|
||||
---*/
|
||||
var TAConstructors = [
|
||||
Float64Array,
|
||||
Float32Array,
|
||||
Int32Array,
|
||||
Int16Array,
|
||||
Int8Array,
|
||||
Uint32Array,
|
||||
Uint16Array,
|
||||
Uint8Array,
|
||||
Uint8ClampedArray
|
||||
];
|
||||
|
||||
var length = TAConstructors.length;
|
||||
|
||||
assert(
|
||||
arrayContains(typedArrayConstructors, TAConstructors),
|
||||
"All TypedArray constructors are accounted for"
|
||||
);
|
||||
assert(typeof TypedArray === "function");
|
||||
assert.sameValue(TypedArray, Object.getPrototypeOf(Uint8Array));
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
testWithTypedArrayConstructors(() => callCount++);
|
||||
assert.sameValue(callCount, length);
|
||||
assert.sameValue(callCount, 9);
|
||||
|
||||
assert.sameValue(typedArrayConstructors[0], Float64Array);
|
||||
assert.sameValue(typedArrayConstructors[1], Float32Array);
|
||||
|
@ -48,13 +30,3 @@ assert.sameValue(typedArrayConstructors[5], Uint32Array);
|
|||
assert.sameValue(typedArrayConstructors[6], Uint16Array);
|
||||
assert.sameValue(typedArrayConstructors[7], Uint8Array);
|
||||
assert.sameValue(typedArrayConstructors[8], Uint8ClampedArray);
|
||||
|
||||
assert.sameValue(typedArrayConstructors[0], TAConstructors[0]);
|
||||
assert.sameValue(typedArrayConstructors[1], TAConstructors[1]);
|
||||
assert.sameValue(typedArrayConstructors[2], TAConstructors[2]);
|
||||
assert.sameValue(typedArrayConstructors[3], TAConstructors[3]);
|
||||
assert.sameValue(typedArrayConstructors[4], TAConstructors[4]);
|
||||
assert.sameValue(typedArrayConstructors[5], TAConstructors[5]);
|
||||
assert.sameValue(typedArrayConstructors[6], TAConstructors[6]);
|
||||
assert.sameValue(typedArrayConstructors[7], TAConstructors[7]);
|
||||
assert.sameValue(typedArrayConstructors[8], TAConstructors[8]);
|
||||
|
|
Loading…
Reference in New Issue