diff --git a/uni_modules/uts-syntaxcase/utssdk/index.uts b/uni_modules/uts-syntaxcase/utssdk/index.uts index 7c1de1ec77cc12aa3b3697e0c82f5430ef358f50..0c18337f3879266e486cd97f3cfd093ab777d9f2 100644 --- a/uni_modules/uts-syntaxcase/utssdk/index.uts +++ b/uni_modules/uts-syntaxcase/utssdk/index.uts @@ -1,23 +1,6 @@ -import { RequestTask, SyncOptions } from "./interface.uts"; +import { RequestTask, SyncOptions, AsyncOptions, SyntaxResult, SyncResult, TestOptions } from "./interface.uts"; import { log } from "./utils.uts"; -export type AsyncOptions = { - type : string; - success : (res : string) => void; - fail : (res : string) => void; - complete : (res : string) => void; -}; -export type { - SyncOptions -} from "./interface.uts"; - -type SyntaxResult = { - name : string -}; - -type SyncResult = { - msg : string -} /** * 导出一个属性 @@ -115,11 +98,6 @@ export async function testAsyncParam3(id : number, name : string, opts : AsyncOp } -export type TestOptions = { - name : string; - callback : (res : string) => void; -}; - export class Test { id : number; name : string; diff --git a/uni_modules/uts-syntaxcase/utssdk/interface.uts b/uni_modules/uts-syntaxcase/utssdk/interface.uts index 3a29e4614b71811cf9dad19a5a604274523af695..4a7e8fd07500bd059523e2d9de0458930c17d125 100644 --- a/uni_modules/uts-syntaxcase/utssdk/interface.uts +++ b/uni_modules/uts-syntaxcase/utssdk/interface.uts @@ -8,4 +8,24 @@ export interface RequestTask { abort() : RequestTask onCallback(callback : (res : string) => void) : void sync(options : SyncOptions) : string -} \ No newline at end of file +} + +export type AsyncOptions = { + type : string; + success : (res : string) => void; + fail : (res : string) => void; + complete : (res : string) => void; +}; + +export type SyntaxResult = { + name : string +}; + +export type SyncResult = { + msg : string +} + +export type TestOptions = { + name : string; + callback : (res : string) => void; +}; \ No newline at end of file diff --git a/uni_modules/uts-tests/utssdk/ArrayBuffer.uts b/uni_modules/uts-tests/utssdk/ArrayBuffer.uts index 2f66bd12da5f957d747db6a5a7c4329456c4e57d..9908c31e4eddb988095e933db39f42212b6c021e 100644 --- a/uni_modules/uts-tests/utssdk/ArrayBuffer.uts +++ b/uni_modules/uts-tests/utssdk/ArrayBuffer.uts @@ -23,6 +23,7 @@ const int16 = new TInt16Array() export function testArrayBuffer() : Result { return describe("ArrayBuffer", () => { + // #ifdef APP-ANDROID //dataview start test('dataview_constructor', () => { tDataView.setConstructor() @@ -725,7 +726,7 @@ export function testArrayBuffer() : Result { test('uint32_arrayBufferSlice', () => { uint32.arrayBufferSlice() }) - + // #endif //uint32 end }) } \ No newline at end of file diff --git a/uni_modules/uts-tests/utssdk/TDataView.uts b/uni_modules/uts-tests/utssdk/TDataView.uts index 3e03ce54d08565926583358de31a5fe8db668702..4191e6aa5cbfa37fe42fd1eb7f4604a777d77ea9 100644 --- a/uni_modules/uts-tests/utssdk/TDataView.uts +++ b/uni_modules/uts-tests/utssdk/TDataView.uts @@ -18,6 +18,7 @@ export class TDataView { // this.setUint8(); // this.testMix(); } + // #ifdef APP-ANDROID setConstructor() { let buffer = new ArrayBuffer(16); let dataview = new DataView(buffer); @@ -327,4 +328,5 @@ class LittleEndian { this.uint8View_[byteOffset + 3] * (1 << 24) ); } + // #endif } \ No newline at end of file diff --git a/uni_modules/uts-tests/utssdk/TFloat32Array.uts b/uni_modules/uts-tests/utssdk/TFloat32Array.uts index 682836aa73e0e278b6d0abb2d9b4d54bf6e4b251..ffed4d872bab1e0a1653271f55b6784fd8750cfc 100644 --- a/uni_modules/uts-tests/utssdk/TFloat32Array.uts +++ b/uni_modules/uts-tests/utssdk/TFloat32Array.uts @@ -7,6 +7,7 @@ import { export class TFloat32Array { test() { + // #ifdef APP-ANDROID this.testfloat32(); this.testConstructor(); this.testSet(); @@ -31,7 +32,9 @@ export class TFloat32Array { this.subarray(); this.values(); this.arrayBufferSlice(); + // #endif } + // #ifdef APP-ANDROID from(){ var float32Array= Float32Array.from([1, 2, 3], (v: number, _: number):number => v + v); expect(float32Array.toString()).toEqual('2,4,6'); @@ -285,4 +288,5 @@ export class TFloat32Array { let sliced = new Float32Array(res); expect(sliced[1]).toEqual(42); } + // #endif } \ No newline at end of file diff --git a/uni_modules/uts-tests/utssdk/TFloat64Array.uts b/uni_modules/uts-tests/utssdk/TFloat64Array.uts index 531735139c5d8ea550d30a5d4402059bab5f6b61..92e7e230b9a9410433e6b2296b4e394ec2bae49d 100644 --- a/uni_modules/uts-tests/utssdk/TFloat64Array.uts +++ b/uni_modules/uts-tests/utssdk/TFloat64Array.uts @@ -7,6 +7,7 @@ import { export class TFloat64Array { test() { + // #ifdef APP-ANDROID this.testfloat64(); this.testConstructor(); this.testSet(); @@ -31,8 +32,9 @@ export class TFloat64Array { this.subarray(); this.values(); this.arrayBufferSlice(); + // #endif } - +// #ifdef APP-ANDROID testfloat64() { let float32 = new Float64Array(2); float32[0] = 42; @@ -276,4 +278,5 @@ export class TFloat64Array { let sliced = new Float64Array(res); expect(sliced[0]).toEqual(42); } + // #endif } \ No newline at end of file diff --git a/uni_modules/uts-tests/utssdk/TInt16Array.uts b/uni_modules/uts-tests/utssdk/TInt16Array.uts index f9f714510b50c102049e65df4c78cd13ce5a8ba3..d527a0dc2515ca9ad5bff2740df3d98c985464bc 100644 --- a/uni_modules/uts-tests/utssdk/TInt16Array.uts +++ b/uni_modules/uts-tests/utssdk/TInt16Array.uts @@ -7,6 +7,7 @@ import { export class TInt16Array { test() { + // #ifdef APP-ANDROID this.testConstructor(); this.testSet(); this.testCopyWith(); @@ -30,9 +31,10 @@ export class TInt16Array { this.subarray(); this.values(); this.arrayBufferSlice(); + // #endif } - +// #ifdef APP-ANDROID testConstructor() { let buffer = new ArrayBuffer(16); let float32 = new Int16Array(buffer); @@ -250,4 +252,5 @@ export class TInt16Array { let sliced = new Int16Array(res); expect(sliced[0]).toEqual(42); } + // #endif } \ No newline at end of file diff --git a/uni_modules/uts-tests/utssdk/TInt32Array.uts b/uni_modules/uts-tests/utssdk/TInt32Array.uts index 9ef3aee7ccc4197fe45ffa9468249764b8ac7ef4..c837b5d4f951b54e8c034e7106f3ea48ded599c7 100644 --- a/uni_modules/uts-tests/utssdk/TInt32Array.uts +++ b/uni_modules/uts-tests/utssdk/TInt32Array.uts @@ -7,6 +7,7 @@ import { export class TInt32Array { test() { + // #ifdef APP-ANDROID this.testfloat32(); this.testConstructor(); this.testSet(); @@ -31,8 +32,10 @@ export class TInt32Array { this.subarray(); this.values(); this.arrayBufferSlice(); + // #endif } +// #ifdef APP-ANDROID testfloat32() { let float32 = new Int32Array(2); float32[0] = 42; @@ -266,4 +269,5 @@ export class TInt32Array { let sliced = new Int32Array(res); expect(sliced[1]).toEqual(42); } + // #endif } diff --git a/uni_modules/uts-tests/utssdk/TInt8Array.uts b/uni_modules/uts-tests/utssdk/TInt8Array.uts index e89f52e37942a422a78bfa4c6078b117665d2153..76f6c4472f07045a37f2c9ea5b29a3718741a74d 100644 --- a/uni_modules/uts-tests/utssdk/TInt8Array.uts +++ b/uni_modules/uts-tests/utssdk/TInt8Array.uts @@ -8,6 +8,7 @@ import { export class TInt8Array { test() { + // #ifdef APP-ANDROID this.testConstructor(); this.testSet(); this.testCopyWith(); @@ -31,9 +32,10 @@ export class TInt8Array { this.subarray(); this.values(); this.arrayBufferSlice(); + //#endif } - +// #ifdef APP-ANDROID testConstructor() { let buffer = new ArrayBuffer(16); let int8View = new Int8Array(buffer); @@ -261,4 +263,5 @@ export class TInt8Array { let sliced = new Int8Array(res); expect(sliced[0]).toEqual(42); } + // #endif } \ No newline at end of file diff --git a/uni_modules/uts-tests/utssdk/TUInt8Array.uts b/uni_modules/uts-tests/utssdk/TUInt8Array.uts index c4b417beec1d07e70738986aa9a8ef7e2210b628..41a24440daac569bcc74677461795c69fe514040 100644 --- a/uni_modules/uts-tests/utssdk/TUInt8Array.uts +++ b/uni_modules/uts-tests/utssdk/TUInt8Array.uts @@ -7,6 +7,7 @@ import { export class TUint8Array { test() { + // #ifdef APP-ANDROID this.testMAX(); this.testConstructor(); this.testSet(); @@ -31,7 +32,9 @@ export class TUint8Array { this.subarray(); this.values(); this.arrayBufferSlice(); + // #endif } + // #ifdef APP-ANDROID from() { var s = new Set([1, 2, 3]); var unit8 = Uint8Array.from(s); @@ -264,4 +267,5 @@ export class TUint8Array { let sliced = new Uint8Array(res); expect(sliced[0]).toEqual(42); } + // #endif } \ No newline at end of file diff --git a/uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts b/uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts index 862e803798cc7f4fb165a0d003634573c03da6fa..6eb8fcac66f34322525515ac5a8c16f59a720057 100644 --- a/uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts +++ b/uni_modules/uts-tests/utssdk/TUInt8ClampedArray.uts @@ -7,6 +7,7 @@ import { export class TUint8ClampedArray { test() { + // #ifdef APP-ANDROID this.testMAX(); this.testConstructor(); this.testSet(); @@ -31,8 +32,10 @@ export class TUint8ClampedArray { this.subarray(); this.values(); this.arrayBufferSlice(); + // #endif } +// #ifdef APP-ANDROID testMAX() { let float32 = new Uint8ClampedArray(16); float32[0] = 255; @@ -259,4 +262,5 @@ export class TUint8ClampedArray { let sliced = new Uint8ClampedArray(res); expect(sliced[0]).toEqual(42); } + // #endif } \ No newline at end of file diff --git a/uni_modules/uts-tests/utssdk/TUint16Array.uts b/uni_modules/uts-tests/utssdk/TUint16Array.uts index 06f5a7cd9965c72952b79e8ae22fc469b895a43e..efd82537b30b8a16b13171f373c471aa6798abe6 100644 --- a/uni_modules/uts-tests/utssdk/TUint16Array.uts +++ b/uni_modules/uts-tests/utssdk/TUint16Array.uts @@ -7,6 +7,7 @@ import { export class TUint16Array { test() { + // #ifdef APP-ANDROID this.testfloat32(); this.testConstructor(); this.testSet(); @@ -31,8 +32,10 @@ export class TUint16Array { this.subarray(); this.values(); this.arrayBufferSlice(); + // #endif } - + + // #ifdef APP-ANDROID testfloat32() { let float32 = new Uint16Array(2); float32[0] = 42; @@ -273,4 +276,6 @@ export class TUint16Array { let sliced = new Uint16Array(res); expect(sliced[0]).toEqual(42); } + // #endif + } \ No newline at end of file diff --git a/uni_modules/uts-tests/utssdk/TUint32Array.uts b/uni_modules/uts-tests/utssdk/TUint32Array.uts index ac621d799f6058679369538ddac6184476188a41..a1716b3b6afccfc470e956b66836bac7947b71dd 100644 --- a/uni_modules/uts-tests/utssdk/TUint32Array.uts +++ b/uni_modules/uts-tests/utssdk/TUint32Array.uts @@ -7,6 +7,7 @@ import { export class TUint32Array { test() { + // #ifdef APP-ANDROID this.testfloat32(); this.testConstructor(); this.testSet(); @@ -31,8 +32,10 @@ export class TUint32Array { this.subarray(); this.values(); this.arrayBufferSlice(); + // #endif } +// #ifdef APP-ANDROID testfloat32() { let float32 = new Uint32Array(2); float32[0] = 42; @@ -273,4 +276,5 @@ export class TUint32Array { let sliced = new Uint32Array(res); expect(sliced[1]).toEqual(42); } + // #endif } \ No newline at end of file