diff options
author | ZYSzys <17367077526@163.com> | 2018-12-15 16:15:40 +0800 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-12-18 05:24:45 +0100 |
commit | 8828426af45adc29847d0d20717c8fa3eb9bb523 (patch) | |
tree | 5da8cb7a5fa2b6da9b3affc449c45d5cf4d292ec /test/parallel/test-util-types.js | |
parent | 9190e4ecdf891892e479b0ef4b691252d4084806 (diff) | |
download | android-node-v8-8828426af45adc29847d0d20717c8fa3eb9bb523.tar.gz android-node-v8-8828426af45adc29847d0d20717c8fa3eb9bb523.tar.bz2 android-node-v8-8828426af45adc29847d0d20717c8fa3eb9bb523.zip |
test: test internal/util/types in vm
PR-URL: https://github.com/nodejs/node/pull/25056
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'test/parallel/test-util-types.js')
-rw-r--r-- | test/parallel/test-util-types.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/parallel/test-util-types.js b/test/parallel/test-util-types.js index 64434e574a..eba8583ee7 100644 --- a/test/parallel/test-util-types.js +++ b/test/parallel/test-util-types.js @@ -82,6 +82,40 @@ for (const [ value, _method ] of [ { assert(!types.isUint8Array({ [Symbol.toStringTag]: 'Uint8Array' })); assert(types.isUint8Array(vm.runInNewContext('new Uint8Array'))); + + assert(!types.isUint8ClampedArray({ + [Symbol.toStringTag]: 'Uint8ClampedArray' + })); + assert(types.isUint8ClampedArray( + vm.runInNewContext('new Uint8ClampedArray') + )); + + assert(!types.isUint16Array({ [Symbol.toStringTag]: 'Uint16Array' })); + assert(types.isUint16Array(vm.runInNewContext('new Uint16Array'))); + + assert(!types.isUint32Array({ [Symbol.toStringTag]: 'Uint32Array' })); + assert(types.isUint32Array(vm.runInNewContext('new Uint32Array'))); + + assert(!types.isInt8Array({ [Symbol.toStringTag]: 'Int8Array' })); + assert(types.isInt8Array(vm.runInNewContext('new Int8Array'))); + + assert(!types.isInt16Array({ [Symbol.toStringTag]: 'Int16Array' })); + assert(types.isInt16Array(vm.runInNewContext('new Int16Array'))); + + assert(!types.isInt32Array({ [Symbol.toStringTag]: 'Int32Array' })); + assert(types.isInt32Array(vm.runInNewContext('new Int32Array'))); + + assert(!types.isFloat32Array({ [Symbol.toStringTag]: 'Float32Array' })); + assert(types.isFloat32Array(vm.runInNewContext('new Float32Array'))); + + assert(!types.isFloat64Array({ [Symbol.toStringTag]: 'Float64Array' })); + assert(types.isFloat64Array(vm.runInNewContext('new Float64Array'))); + + assert(!types.isBigInt64Array({ [Symbol.toStringTag]: 'BigInt64Array' })); + assert(types.isBigInt64Array(vm.runInNewContext('new BigInt64Array'))); + + assert(!types.isBigUint64Array({ [Symbol.toStringTag]: 'BigUint64Array' })); + assert(types.isBigUint64Array(vm.runInNewContext('new BigUint64Array'))); } { |