From b4b0d855b309a6560321c45c8af86127d9405086 Mon Sep 17 00:00:00 2001 From: duqingquan Date: Fri, 1 Nov 2024 16:34:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=A0JSON.parse=E8=A7=A3=E6=9E=90=E6=95=B0?= =?UTF-8?q?=E5=AD=97=E8=BF=94=E5=9B=9E=E7=B1=BB=E5=9E=8B=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E4=B8=BAdouble=EF=BC=8C=E8=B0=83=E6=95=B4=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uni_modules/uts-tests/utssdk/UTSJSONObject.uts | 2 +- uni_modules/uts-tests/utssdk/console.uts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/uni_modules/uts-tests/utssdk/UTSJSONObject.uts b/uni_modules/uts-tests/utssdk/UTSJSONObject.uts index bb265f8..9682272 100644 --- a/uni_modules/uts-tests/utssdk/UTSJSONObject.uts +++ b/uni_modules/uts-tests/utssdk/UTSJSONObject.uts @@ -57,7 +57,7 @@ export function testUTSJSONObject() : Result { } let data2 = JSON.parse(JSON.stringify(data1)) - expect(data2!.toJSONString()).toEqual('{"str":"test","num":1,"num2":2.369}') + expect(data2!.toJSONString()).toEqual('{"str":"test","num":1.0,"num2":2.369}') class TestData2 implements IJSONStringify{ toJSON():any|null{ diff --git a/uni_modules/uts-tests/utssdk/console.uts b/uni_modules/uts-tests/utssdk/console.uts index f5c30b3..e01b79c 100644 --- a/uni_modules/uts-tests/utssdk/console.uts +++ b/uni_modules/uts-tests/utssdk/console.uts @@ -30,7 +30,7 @@ export function testConsole() : Result { let aj2 = JSON.parse('{"a":1}') as UTSJSONObject; - expect(obtainInnerObject(aj2['a']).get("type")).toEqual("Int"); + expect(obtainInnerObject(aj2['a']).get("type")).toEqual("Double"); expect(obtainInnerObject(aj2['a']).get("subType")).toEqual("number"); // #endif -- GitLab