From 488fe7eadcfc76c542462d4e7ceb75753fdff72a Mon Sep 17 00:00:00 2001 From: duqingquan Date: Sat, 21 Sep 2024 13:07:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0custom-stringify=20=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6=E7=BC=96=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uni_modules/uts-tests/utssdk/JSON.uts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/uni_modules/uts-tests/utssdk/JSON.uts b/uni_modules/uts-tests/utssdk/JSON.uts index cdf8917..9a815e2 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', () => { -- GitLab