diff --git a/uni_modules/uts-tests/utssdk/ArrayBuffer.uts b/uni_modules/uts-tests/utssdk/ArrayBuffer.uts index 5f4dd0ac42ac6015280dbd31a3a40b093fb38850..224f7d676b9ee029e0ea5e8acba61b5f138de2d1 100644 --- a/uni_modules/uts-tests/utssdk/ArrayBuffer.uts +++ b/uni_modules/uts-tests/utssdk/ArrayBuffer.uts @@ -9,7 +9,7 @@ import { TUint8Array } from './TUint8Array.uts' import { TUint8ClampedArray } from './TUint8ClampedArray.uts' import { TUint16Array } from './TUint16Array.uts' import { TUint32Array } from './TUint32Array.uts' -// #ifdef UNI-APP-X && APP-ANDROID +// #ifdef APP-ANDROID import ByteBuffer from 'java.nio.ByteBuffer'; // #endif @@ -26,7 +26,7 @@ const int16 = new TInt16Array() export function testArrayBuffer() : Result { return describe("ArrayBuffer", () => { - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB + // #ifdef APP-ANDROID || WEB test('arraybuffer_isview', () => { // #TEST ArrayBuffer.isView var arrayBuffer = new ArrayBuffer(16) @@ -42,7 +42,7 @@ export function testArrayBuffer() : Result { expect(isViewA).toEqual(false); }) - // #ifdef UNI-APP-X && APP-ANDROID + // #ifdef APP-ANDROID test('arraybuffer_toByteBuffer', () => { // #TEST ArrayBuffer.fromByteBuffer,ArrayBuffer.toByteBuffer var byteBuffer = ByteBuffer.allocate(100) diff --git a/uni_modules/uts-tests/utssdk/TDataView.uts b/uni_modules/uts-tests/utssdk/TDataView.uts index 988c93ba6d23881985ce0d08f39bf239ceebb013..1ca5019268607a30118278be700cf6faf9e284b9 100644 --- a/uni_modules/uts-tests/utssdk/TDataView.uts +++ b/uni_modules/uts-tests/utssdk/TDataView.uts @@ -18,7 +18,7 @@ export class TDataView { // this.setUint8(); // this.testMix(); } - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB + // #ifdef APP-ANDROID || WEB setConstructor() { let buffer = new ArrayBuffer(16); let dataview = new DataView(buffer); diff --git a/uni_modules/uts-tests/utssdk/TFloat32Array.uts b/uni_modules/uts-tests/utssdk/TFloat32Array.uts index 010b10a051aac5170bbb2338c157274950f6d5c7..10044a1d02a078ca8006087be8fb5b3832e47b7c 100644 --- a/uni_modules/uts-tests/utssdk/TFloat32Array.uts +++ b/uni_modules/uts-tests/utssdk/TFloat32Array.uts @@ -7,7 +7,7 @@ import { export class TFloat32Array { test() { - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB + // #ifdef APP-ANDROID || WEB this.testfloat32(); this.testConstructor(); this.testSet(); @@ -34,7 +34,7 @@ export class TFloat32Array { this.arrayBufferSlice(); // #endif } - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB + // #ifdef APP-ANDROID || WEB from() { var float32Array = Float32Array.from([1, 2, 3], (v : number, _ : number) : number => v + v); expect(float32Array.toString()).toEqual('2,4,6'); diff --git a/uni_modules/uts-tests/utssdk/TFloat64Array.uts b/uni_modules/uts-tests/utssdk/TFloat64Array.uts index 5f65fcb9572cf0c4fff372fc37e65ee8c63db81e..3eaad42ab70b2defe76594794ad817289f11ebfb 100644 --- a/uni_modules/uts-tests/utssdk/TFloat64Array.uts +++ b/uni_modules/uts-tests/utssdk/TFloat64Array.uts @@ -7,7 +7,7 @@ import { export class TFloat64Array { test() { - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB + // #ifdef APP-ANDROID || WEB this.testfloat64(); this.testConstructor(); this.testSet(); @@ -34,7 +34,7 @@ export class TFloat64Array { this.arrayBufferSlice(); // #endif } - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB + // #ifdef APP-ANDROID || WEB testfloat64() { let float64 = new Float64Array(2); float64[0] = 42; diff --git a/uni_modules/uts-tests/utssdk/TInt16Array.uts b/uni_modules/uts-tests/utssdk/TInt16Array.uts index 287fa734f8002af734c494e3eb47591522f602a1..94af5e724aaed92e0cdd9010e6dd5545b605f4a0 100644 --- a/uni_modules/uts-tests/utssdk/TInt16Array.uts +++ b/uni_modules/uts-tests/utssdk/TInt16Array.uts @@ -7,7 +7,7 @@ import { export class TInt16Array { test() { - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB + // #ifdef APP-ANDROID || WEB this.testConstructor(); this.testSet(); this.testCopyWith(); @@ -34,7 +34,7 @@ export class TInt16Array { // #endif } - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB + // #ifdef APP-ANDROID || WEB testConstructor() { let buffer = new ArrayBuffer(16); diff --git a/uni_modules/uts-tests/utssdk/TInt32Array.uts b/uni_modules/uts-tests/utssdk/TInt32Array.uts index 1e1672db2c6b1320a3c6f04224a721a0445c4616..3698e6214d9d519f7629a7de9f13bea74bfa94bf 100644 --- a/uni_modules/uts-tests/utssdk/TInt32Array.uts +++ b/uni_modules/uts-tests/utssdk/TInt32Array.uts @@ -7,7 +7,7 @@ import { export class TInt32Array { test() { - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB + // #ifdef APP-ANDROID || WEB this.testInt32Array(); this.testConstructor(); @@ -36,7 +36,7 @@ export class TInt32Array { // #endif } - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB + // #ifdef APP-ANDROID || WEB testInt32Array() { let int32 = new Int32Array(2); @@ -174,8 +174,10 @@ export class TInt32Array { let res1 = int32_t1.includes(2); console.log(res1); // true - let res2 = int32_t1.includes(4); - console.log(res2); // false + res = int32.includes(4); + console.log(res); // false + + // expect(res).toEqual(false); let res3 = int32_t1.includes(3, 3); console.log(res3); // false diff --git a/uni_modules/uts-tests/utssdk/TInt8Array.uts b/uni_modules/uts-tests/utssdk/TInt8Array.uts index 966509fe1efb5b1e3709051fa679c04914bf289a..7c1b82e8eb7c805d339c069d26e1d7a2fdb7b887 100644 --- a/uni_modules/uts-tests/utssdk/TInt8Array.uts +++ b/uni_modules/uts-tests/utssdk/TInt8Array.uts @@ -8,7 +8,7 @@ import { export class TInt8Array { test() { - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB + // #ifdef APP-ANDROID || WEB this.testConstructor(); this.testSet(); @@ -36,7 +36,7 @@ export class TInt8Array { //#endif } - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB + // #ifdef APP-ANDROID || WEB testConstructor() { let buffer = new ArrayBuffer(16); diff --git a/uni_modules/uts-tests/utssdk/TUInt8Array.uts b/uni_modules/uts-tests/utssdk/TUInt8Array.uts index cfc7ab8930e8809b35d6b8a7bc220a8636bbd624..4972cd84d71ddd43486f10a04487c9c251e7e80e 100644 --- a/uni_modules/uts-tests/utssdk/TUInt8Array.uts +++ b/uni_modules/uts-tests/utssdk/TUInt8Array.uts @@ -7,7 +7,7 @@ import { export class TUint8Array { test() { - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB + // #ifdef APP-ANDROID || WEB this.testMAX(); this.testConstructor(); @@ -35,7 +35,7 @@ export class TUint8Array { this.arrayBufferSlice(); // #endif } - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB + // #ifdef APP-ANDROID || WEB from() { var s = new Set([1, 2, 3]); diff --git a/uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts b/uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts index 221e453c3565322276f3aa1af52f937f8465ceeb..48b2cd6e0f80b783145d9cd26e06e3c5799675e8 100644 --- a/uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts +++ b/uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts @@ -7,7 +7,7 @@ import { export class TUint8ClampedArray { test() { - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB + // #ifdef APP-ANDROID || WEB this.testMAX(); this.testConstructor(); @@ -36,7 +36,7 @@ export class TUint8ClampedArray { // #endif } - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB + // #ifdef APP-ANDROID || WEB testMAX() { let uint8Clamped = new Uint8ClampedArray(16); diff --git a/uni_modules/uts-tests/utssdk/TUint16Array.uts b/uni_modules/uts-tests/utssdk/TUint16Array.uts index 4ada02d0ddafd7ad9e4cace09d7e331028461729..7d0d9ab040c09c0aa8e0457960d687bcce3acde3 100644 --- a/uni_modules/uts-tests/utssdk/TUint16Array.uts +++ b/uni_modules/uts-tests/utssdk/TUint16Array.uts @@ -7,7 +7,7 @@ import { export class TUint16Array { test() { - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB + // #ifdef APP-ANDROID || WEB this.testuint16(); this.testConstructor(); this.testSet(); @@ -35,7 +35,7 @@ export class TUint16Array { // #endif } - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB + // #ifdef APP-ANDROID || WEB testuint16() { let uint16 = new Uint16Array(2); uint16[0] = 42; diff --git a/uni_modules/uts-tests/utssdk/TUint32Array.uts b/uni_modules/uts-tests/utssdk/TUint32Array.uts index 3099ff8660f8951f42fc3cf4d0000430017d10a7..e1c9f5284e9dd027eb4190b72582db195e0eb75b 100644 --- a/uni_modules/uts-tests/utssdk/TUint32Array.uts +++ b/uni_modules/uts-tests/utssdk/TUint32Array.uts @@ -7,7 +7,7 @@ import { export class TUint32Array { test() { - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB + // #ifdef APP-ANDROID || WEB this.testuint32(); this.testConstructor(); @@ -36,7 +36,7 @@ export class TUint32Array { // #endif } - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB + // #ifdef APP-ANDROID || WEB testuint32() { let uint32 = new Uint32Array(2); uint32[0] = 42; diff --git a/uni_modules/uts-tests/utssdk/index.uts b/uni_modules/uts-tests/utssdk/index.uts index 023231e26d3073cb4a24fb6d04fe8535cf01dfd4..2c4c08452a9239f6a18abff4a241e81e6d5cf4bd 100644 --- a/uni_modules/uts-tests/utssdk/index.uts +++ b/uni_modules/uts-tests/utssdk/index.uts @@ -3,10 +3,10 @@ import { testDate } from './Date.uts' import { testString } from './String.uts' import { testError } from './Error.uts' import { testKeyWord } from './KeyWord.uts' -import { testJSON } from './JSON.uts' -import { testJSONLarge } from './JSON_large.uts' -import { testUTSJSONObject } from './UTSJSONObject.uts' -import { testConsole } from './console.uts' +import { testJSON } from './JSON.uts' +import { testJSONLarge } from './JSON_large.uts' +import { testUTSJSONObject } from './UTSJSONObject.uts' +import { testConsole } from './console.uts' import { testNumber } from './Number.uts' import { testMap } from './Map.uts' import { testSet } from './Set.uts' @@ -16,9 +16,9 @@ import { testRegExp } from './RegExp.uts' import { testForLoop } from './ForLoop.uts' import { testGlobal } from './Global.uts' import { testType } from './Type.uts' -export { Result } from './tests.uts' -import { testArrayBuffer } from './ArrayBuffer.uts' -import { testNativeCode } from './NativeCode.uts' +export { Result } from './tests.uts' +import { testArrayBuffer } from './ArrayBuffer.uts' +import { testNativeCode } from './NativeCode.uts' // Promise、Proxy、Reflect、Weakmap、WeakSet 不支持 @@ -37,22 +37,22 @@ export function runTests() : UTSJSONObject { const KeyWordRes = testKeyWord(); const ForLoopRes = testForLoop(); const GlobalRes = testGlobal(); - const TypeRes = testType(); + const TypeRes = testType(); const JSONLargeRes = testJSONLarge(); - const consoleRes = testConsole(); - const UTSJSONObjectRes = testUTSJSONObject(); - - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB - const ArrayBufferRes = testArrayBuffer(); - // #endif + const consoleRes = testConsole(); + const UTSJSONObjectRes = testUTSJSONObject(); + + // #ifdef APP-ANDROID || WEB + const ArrayBufferRes = testArrayBuffer(); + // #endif const NativeCodeRes = testNativeCode(); return { Array: ArrayRes, Date: DateRes, String: StringRes, Error: ErrorRes, - Json: JsonRes, - JSONLarge:JSONLargeRes, + Json: JsonRes, + JSONLarge: JSONLargeRes, Number: NumberRes, Map: MapRes, Set: SetRes, @@ -61,13 +61,13 @@ export function runTests() : UTSJSONObject { RegExp: RegExpRes, KeyWord: KeyWordRes, ForLoop: ForLoopRes, - Global: GlobalRes, - Type: TypeRes, - console:consoleRes, - UTSJSONObject:UTSJSONObjectRes, - // #ifdef (UNI-APP-X && APP-ANDROID) || WEB - ArrayBuffer:ArrayBufferRes, - // #endif - NativeCode:NativeCodeRes + Global: GlobalRes, + Type: TypeRes, + console: consoleRes, + UTSJSONObject: UTSJSONObjectRes, + // #ifdef APP-ANDROID || WEB + ArrayBuffer: ArrayBufferRes, + // #endif + NativeCode: NativeCodeRes } } \ No newline at end of file