Skip to content

Commit 1d083e2

Browse files
ZYSzysBethGriggs
authored andcommitted
test: test internal/util/types in vm
PR-URL: #25056 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 027ca95 commit 1d083e2

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

test/parallel/test-util-types.js

+34
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,40 @@ for (const [ value, _method ] of [
8181
{
8282
assert(!types.isUint8Array({ [Symbol.toStringTag]: 'Uint8Array' }));
8383
assert(types.isUint8Array(vm.runInNewContext('new Uint8Array')));
84+
85+
assert(!types.isUint8ClampedArray({
86+
[Symbol.toStringTag]: 'Uint8ClampedArray'
87+
}));
88+
assert(types.isUint8ClampedArray(
89+
vm.runInNewContext('new Uint8ClampedArray')
90+
));
91+
92+
assert(!types.isUint16Array({ [Symbol.toStringTag]: 'Uint16Array' }));
93+
assert(types.isUint16Array(vm.runInNewContext('new Uint16Array')));
94+
95+
assert(!types.isUint32Array({ [Symbol.toStringTag]: 'Uint32Array' }));
96+
assert(types.isUint32Array(vm.runInNewContext('new Uint32Array')));
97+
98+
assert(!types.isInt8Array({ [Symbol.toStringTag]: 'Int8Array' }));
99+
assert(types.isInt8Array(vm.runInNewContext('new Int8Array')));
100+
101+
assert(!types.isInt16Array({ [Symbol.toStringTag]: 'Int16Array' }));
102+
assert(types.isInt16Array(vm.runInNewContext('new Int16Array')));
103+
104+
assert(!types.isInt32Array({ [Symbol.toStringTag]: 'Int32Array' }));
105+
assert(types.isInt32Array(vm.runInNewContext('new Int32Array')));
106+
107+
assert(!types.isFloat32Array({ [Symbol.toStringTag]: 'Float32Array' }));
108+
assert(types.isFloat32Array(vm.runInNewContext('new Float32Array')));
109+
110+
assert(!types.isFloat64Array({ [Symbol.toStringTag]: 'Float64Array' }));
111+
assert(types.isFloat64Array(vm.runInNewContext('new Float64Array')));
112+
113+
assert(!types.isBigInt64Array({ [Symbol.toStringTag]: 'BigInt64Array' }));
114+
assert(types.isBigInt64Array(vm.runInNewContext('new BigInt64Array')));
115+
116+
assert(!types.isBigUint64Array({ [Symbol.toStringTag]: 'BigUint64Array' }));
117+
assert(types.isBigUint64Array(vm.runInNewContext('new BigUint64Array')));
84118
}
85119

86120
{

0 commit comments

Comments
 (0)