diff --git a/uni_modules/uts-tests/utssdk/TFloat32Array.js b/uni_modules/uts-tests/utssdk/TFloat32Array.js index e12839c04703a07dfa39fe3351c426172137f31c..f53690af56dbcad65c9fc0df0a023e0ecb17fb94 100644 --- a/uni_modules/uts-tests/utssdk/TFloat32Array.js +++ b/uni_modules/uts-tests/utssdk/TFloat32Array.js @@ -203,24 +203,24 @@ export class TFloat32Array { let total = new Float32Array([0, 1, 2, 3]); let res = total.reduce((accumulator: number, currentValue: number, currentIndex: number, array: Float32Array): number => accumulator + currentValue); - expect(res).toEqual(6); + expect(res).toEqual(6.0); total = new Float32Array([0, 1, 2, 3]); res = total.reduce((accumulator: number, currentValue: number, currentIndex: number, array: Float32Array): number => accumulator + currentValue, 8); - expect(res).toEqual(14); + expect(res).toEqual(14.0); } reduceRight() { let total = new Float32Array([0, 1, 2, 3]); let res = total.reduceRight((accumulator: number, currentValue: number, currentIndex: number, array: Float32Array): number => accumulator + currentValue); - expect(res).toEqual(6); + expect(res).toEqual(6.0); total = new Float32Array([0, 1, 2, 3]); res = total.reduceRight((accumulator: number, currentValue: number, currentIndex: number, array: Float32Array): number => accumulator + currentValue, 8); - expect(res).toEqual(14); + expect(res).toEqual(14.0); } reverse() { diff --git a/uni_modules/uts-tests/utssdk/TFloat64Array.js b/uni_modules/uts-tests/utssdk/TFloat64Array.js index fda866db5a077105e7e9a511670f7668e711c417..170a0e6930dc904a9deb3909c563f0d86892c217 100644 --- a/uni_modules/uts-tests/utssdk/TFloat64Array.js +++ b/uni_modules/uts-tests/utssdk/TFloat64Array.js @@ -198,24 +198,24 @@ export class TFloat64Array { let total = new Float64Array([0, 1, 2, 3]); let res = total.reduce((accumulator: number, currentValue: number, currentIndex: number, array: Float64Array): number => accumulator + currentValue); - expect(res).toEqual(6); + expect(res).toEqual(6.0); total = new Float64Array([0, 1, 2, 3]); res = total.reduce((accumulator: number, currentValue: number, currentIndex: number, array: Float64Array): number => accumulator + currentValue, 8); - expect(res).toEqual(14); + expect(res).toEqual(14.0); } reduceRight() { let total = new Float64Array([0, 1, 2, 3]); let res = total.reduceRight((accumulator: number, currentValue: number, currentIndex: number, array: Float64Array): number => accumulator + currentValue); - expect(res).toEqual(6); + expect(res).toEqual(6.0); total = new Float64Array([0, 1, 2, 3]); res = total.reduceRight((accumulator: number, currentValue: number, currentIndex: number, array: Float64Array): number => accumulator + currentValue, 8); - expect(res).toEqual(14); + expect(res).toEqual(14.0); } reverse() { diff --git a/uni_modules/uts-tests/utssdk/TInt16Array.js b/uni_modules/uts-tests/utssdk/TInt16Array.js index 422c6a47632919b1120d2b5f34c2f1da44bf2d9b..90c2f31a3bc19129b9cfebadcbf332252409cd01 100644 --- a/uni_modules/uts-tests/utssdk/TInt16Array.js +++ b/uni_modules/uts-tests/utssdk/TInt16Array.js @@ -177,21 +177,21 @@ export class TInt16Array { reduce() { let total = new Int16Array([0, 1, 2, 3]); let res = total.reduce((accumulator : number, currentValue : number, currentIndex : number, array : Int16Array): number => accumulator + currentValue); - expect(res).toEqual(6); + expect(res).toEqual(6.0); total = new Int16Array([0, 1, 2, 3]); res = total.reduce((accumulator : number, currentValue : number, currentIndex : number, array : Int16Array): number => accumulator + currentValue, 8); - expect(res).toEqual(14); + expect(res).toEqual(14.0); } reduceRight() { let total = new Int16Array([0, 1, 2, 3]); let res = total.reduceRight((accumulator: number, currentValue : number, currentIndex : number, array : Int16Array): number => accumulator + currentValue); - expect(res).toEqual(6); + expect(res).toEqual(6.0); total = new Int16Array([0, 1, 2, 3]); res = total.reduceRight((accumulator: number, currentValue : number, currentIndex : number, array : Int16Array): number => accumulator + currentValue, 8); - expect(res).toEqual(14); + expect(res).toEqual(14.0); } reverse() { diff --git a/uni_modules/uts-tests/utssdk/TInt8Array.js b/uni_modules/uts-tests/utssdk/TInt8Array.js index 91a84faef3032ac7ed13762a7e7b716d0b13d201..3bc37bba975f14801b2df9b60e77f5d91b337b5d 100644 --- a/uni_modules/uts-tests/utssdk/TInt8Array.js +++ b/uni_modules/uts-tests/utssdk/TInt8Array.js @@ -2,7 +2,6 @@ import { describe, test, expect, - expectNumber, Result } from './tests.uts' @@ -182,25 +181,25 @@ export class TInt8Array { let total = new Int8Array([0, 1, 2, 3]); let res = total.reduce((accumulator: number, currentValue: number, currentIndex: number, array: Int8Array): number => accumulator + currentValue); - expect(res).toEqual(6); + expect(res).toEqual(6.0); total = new Int8Array([0, 1, 2, 3]); res = total.reduce((accumulator: number, currentValue: number, currentIndex: number, array: Int8Array): number => accumulator + currentValue, 8); - expect(res).toEqual(14); + expect(res).toEqual(14.0); } reduceRight() { let total = new Int8Array([0, 1, 2, 3]); let res = total.reduceRight((accumulator: number, currentValue: number, currentIndex: number, array: Int8Array): number => accumulator + currentValue); - expect(res).toEqual(6); + expect(res).toEqual(6.0); total = new Int8Array([0, 1, 2, 3]); res = total.reduceRight((accumulator: number, currentValue: number, currentIndex: number, array: Int8Array): number => accumulator + currentValue, 8); - expect(res).toEqual(14); + expect(res).toEqual(14.0); } reverse() { diff --git a/uni_modules/uts-tests/utssdk/TUInt8Array.js b/uni_modules/uts-tests/utssdk/TUInt8Array.js index 018471ac7cd9c489f0ac7ca4b4352e347c8e8002..65c0ebf30bd92163859dd464524b6ee4cf9b9760 100644 --- a/uni_modules/uts-tests/utssdk/TUInt8Array.js +++ b/uni_modules/uts-tests/utssdk/TUInt8Array.js @@ -123,13 +123,13 @@ export class TUint8Array { includes() { let float32 = new Uint8Array([1, 2, 3]); - let res = float32.includes(2); + let res = float32.includes(2.0); expect(res).toEqual(true); - res = float32.includes(4); + res = float32.includes(4.0); expect(res).toEqual(false); - res = float32.includes(3, 3); + res = float32.includes(3.0, 3); expect(res).toEqual(false); } @@ -179,21 +179,21 @@ export class TUint8Array { reduce() { let total = new Uint8Array([0, 1, 2, 3]); let res = total.reduce((accumulator : number, currentValue : number, currentIndex : number, array : Uint8Array): number => accumulator + currentValue); - expect(res).toEqual(6); + expect(res).toEqual(6.0); total = new Uint8Array([0, 1, 2, 3]); res = total.reduce((accumulator : number, currentValue : number, currentIndex : number, array : Uint8Array): number => accumulator + currentValue, 8); - expect(res).toEqual(14); + expect(res).toEqual(14.0); } reduceRight() { let total = new Uint8Array([0, 1, 2, 3]); let res = total.reduceRight((accumulator: number, currentValue : number, currentIndex : number, array : Uint8Array): number => accumulator + currentValue); - expect(res).toEqual(6); + expect(res).toEqual(6.0); total = new Uint8Array([0, 1, 2, 3]); res = total.reduceRight((accumulator: number, currentValue : number, currentIndex : number, array : Uint8Array): number => accumulator + currentValue, 8); - expect(res).toEqual(14); + expect(res).toEqual(14.0); } reverse() { diff --git a/uni_modules/uts-tests/utssdk/TUInt8ClampedArray.js b/uni_modules/uts-tests/utssdk/TUInt8ClampedArray.js index a51e5b494292ff4ad14a69aaeafaf29ef2b5b1eb..6739cdc0bab2cbfebb34c5eaa819fadfae80d944 100644 --- a/uni_modules/uts-tests/utssdk/TUInt8ClampedArray.js +++ b/uni_modules/uts-tests/utssdk/TUInt8ClampedArray.js @@ -125,13 +125,13 @@ export class TUint8ClampedArray { includes() { let float32 = new Uint8ClampedArray([1, 2, 3]); - let res = float32.includes(2); + let res = float32.includes(2.0); expect(res).toEqual(true); - res = float32.includes(4); + res = float32.includes(4.0); expect(res).toEqual(false); - res = float32.includes(3, 3); + res = float32.includes(3.0, 3); expect(res).toEqual(false); } @@ -182,24 +182,24 @@ export class TUint8ClampedArray { let total = new Uint8ClampedArray([0, 1, 2, 3]); let res = total.reduce((accumulator: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray): number => accumulator + currentValue); - expect(res).toEqual(6); + expect(res).toEqual(6.0); total = new Uint8ClampedArray([0, 1, 2, 3]); res = total.reduce((accumulator: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray): number => accumulator + currentValue, 8); - expect(res).toEqual(14); + expect(res).toEqual(14.0); } reduceRight() { let total = new Uint8ClampedArray([0, 1, 2, 3]); let res = total.reduceRight((accumulator: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray): number => accumulator + currentValue); - expect(res).toEqual(6); + expect(res).toEqual(6.0); total = new Uint8ClampedArray([0, 1, 2, 3]); res = total.reduceRight((accumulator: number, currentValue: number, currentIndex: number, array: Uint8ClampedArray): number => accumulator + currentValue, 8); - expect(res).toEqual(14); + expect(res).toEqual(14.0); } reverse() { diff --git a/uni_modules/uts-tests/utssdk/TUint16Array.js b/uni_modules/uts-tests/utssdk/TUint16Array.js index b6294a9334a83e89f679ca470d217f896dfd5e97..c15c63591867c3cec0d40f33210381e3c20bf26e 100644 --- a/uni_modules/uts-tests/utssdk/TUint16Array.js +++ b/uni_modules/uts-tests/utssdk/TUint16Array.js @@ -139,13 +139,13 @@ export class TUint16Array { includes() { let float32 = new Uint16Array([1, 2, 3]); - let res = float32.includes(2); + let res = float32.includes(2.0); expect(res).toEqual(true); - res = float32.includes(4); + res = float32.includes(4.0); expect(res).toEqual(false); - res = float32.includes(3, 3); + res = float32.includes(3.0, 3); expect(res).toEqual(false); } @@ -196,24 +196,24 @@ export class TUint16Array { let total = new Uint16Array([0, 1, 2, 3]); let res = total.reduce((accumulator: number, currentValue: number, currentIndex: number, array: Uint16Array): number => accumulator + currentValue); - expect(res).toEqual(6); + expect(res).toEqual(6.0); total = new Uint16Array([0, 1, 2, 3]); res = total.reduce((accumulator: number, currentValue: number, currentIndex: number, array: Uint16Array): number => accumulator + currentValue, 8); - expect(res).toEqual(14); + expect(res).toEqual(14.0); } reduceRight() { let total = new Uint16Array([0, 1, 2, 3]); let res = total.reduceRight((accumulator: number, currentValue: number, currentIndex: number, array: Uint16Array): number => accumulator + currentValue); - expect(res).toEqual(6); + expect(res).toEqual(6.0); total = new Uint16Array([0, 1, 2, 3]); res = total.reduceRight((accumulator: number, currentValue: number, currentIndex: number, array: Uint16Array): number => accumulator + currentValue, 8); - expect(res).toEqual(14); + expect(res).toEqual(14.0); } reverse() { @@ -266,8 +266,8 @@ export class TUint16Array { arrayBufferSlice() { let buffer = new ArrayBuffer(16); let float32 = new Uint16Array(buffer); - float32[4] = 42; - expect(float32.toString()).toEqual("0,0,0,0,42,0,0,0"); + float32[3] = 42; + expect(float32.toString()).toEqual("0,0,0,42,0,0,0,0"); let res = buffer.slice(8); let sliced = new Uint16Array(res);