From b10d4ccae3f405a6420f2500afa22b6f7531fd55 Mon Sep 17 00:00:00 2001 From: duqingquan Date: Thu, 22 Aug 2024 17:40:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B7=A8=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=BC=95=E5=85=A5UTSJSONObject=20=E7=9A=84=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/Number.uts | 2 +- uni_modules/uts-tests/utssdk/UTSJSONObject.uts | 5 +++-- uni_modules/uts-tests/utssdk/data.uts | 6 ++++++ 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 uni_modules/uts-tests/utssdk/data.uts diff --git a/uni_modules/uts-tests/utssdk/Number.uts b/uni_modules/uts-tests/utssdk/Number.uts index 00645cc..3988248 100644 --- a/uni_modules/uts-tests/utssdk/Number.uts +++ b/uni_modules/uts-tests/utssdk/Number.uts @@ -223,7 +223,7 @@ export function testNumber() : Result { expect((new UTSNumber(0.000001)).toString()).toEqual("0.000001"); expect((new UTSNumber(0.0000001)).toString()).toEqual("1e-7"); expect((new UTSNumber(100000000000000000000.0)).toString()).toEqual("100000000000000000000"); - expect((new UTSNumber(1000000000000000000000.0)).toString()).toEqual("1e21"); + expect((new UTSNumber(1000000000000000000000.0)).toString()).toEqual("1e+21"); // #endif }) diff --git a/uni_modules/uts-tests/utssdk/UTSJSONObject.uts b/uni_modules/uts-tests/utssdk/UTSJSONObject.uts index 26e16fb..c74ee7e 100644 --- a/uni_modules/uts-tests/utssdk/UTSJSONObject.uts +++ b/uni_modules/uts-tests/utssdk/UTSJSONObject.uts @@ -1,5 +1,5 @@ import { describe, test, expect, expectNumber, Result } from './tests.uts' - +import {mockData} from './data.uts' export function testUTSJSONObject() : Result { @@ -10,7 +10,8 @@ export function testUTSJSONObject() : Result { age:11 } expect(UTSJSONObject.keys(obj).length).toEqual(2); - console.log(UTSJSONObject.keys(obj)) + expect(UTSJSONObject.keys(mockData).length).toEqual(2); + }) test('toJSONObject', () => { diff --git a/uni_modules/uts-tests/utssdk/data.uts b/uni_modules/uts-tests/utssdk/data.uts new file mode 100644 index 0000000..08bf9e4 --- /dev/null +++ b/uni_modules/uts-tests/utssdk/data.uts @@ -0,0 +1,6 @@ +const mockData = { + username:"lucy", + age:12 +} + +export {mockData} -- GitLab