diff --git a/uni_modules/uts-tests/utssdk/JSON.uts b/uni_modules/uts-tests/utssdk/JSON.uts index cdf8917b776c4c876812c70af40fb12e0315056b..9a815e24bfcb183f3fdd5e34f6f8fd15c6b09165 100644 --- a/uni_modules/uts-tests/utssdk/JSON.uts +++ b/uni_modules/uts-tests/utssdk/JSON.uts @@ -38,6 +38,7 @@ function countOccurrences(str : string, substr : string) : number { return count; } +// #ifdef APP-ANDROID class A1 implements IJsonStringify{ override toJSON():any|null{ let jsonRet = { @@ -77,18 +78,20 @@ class A6 implements IJsonStringify{ return new A5() } } - +// #endif export function testJSON() : Result { return describe("JSON", () => { test('custom-stringify', () => { + // #ifdef APP-ANDROID expect(JSON.stringify(new A1()).length).toEqual(28) expect(JSON.stringify(new A2())).toEqual("2") expect(JSON.stringify(new A3())).toEqual('"json"') expect(JSON.stringify(new A4())).toEqual('null') expect(JSON.stringify(new A5()).length).toEqual(28) expect(JSON.stringify(new A6()).length).toEqual(28) + // #endif }) test('parse', () => {