From d324439077e6ca9690700995ba6bae007e076cd8 Mon Sep 17 00:00:00 2001 From: m0_75226990 Date: Fri, 21 Jul 2023 12:17:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0number=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 12 ++++++------ uni_modules/uts-tests/utssdk/Number.uts | 16 ++++++++++++++++ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/manifest.json b/manifest.json index 1a2f1e0..d67f328 100644 --- a/manifest.json +++ b/manifest.json @@ -74,10 +74,10 @@ "uniStatistics": { "enable": false }, - "vueVersion": "3", - "uni-app-x" : { - "uvue" : { - "flex-direction" : "cloum" - } - } + "vueVersion": "3" + // "uni-app-x" : { + // "uvue" : { + // "flex-direction" : "cloum" + // } + // } } \ No newline at end of file diff --git a/uni_modules/uts-tests/utssdk/Number.uts b/uni_modules/uts-tests/utssdk/Number.uts index fbf626f..b9109d5 100644 --- a/uni_modules/uts-tests/utssdk/Number.uts +++ b/uni_modules/uts-tests/utssdk/Number.uts @@ -35,5 +35,21 @@ export function testNumber(): Result { expect(1.23e5.toPrecision(4)).toEqual("1.230e+5"); }) + test('toString', () => { + expect((10).toString()).toEqual("10"); + expect((17).toString()).toEqual("17"); + expect((17.2).toString()).toEqual("17.2"); + expect((6).toString(2)).toEqual("110"); + expect((254).toString(16)).toEqual("fe"); + expect((-10).toString(2)).toEqual("-1010"); + expect((-0xff).toString(2)).toEqual("-11111111"); + }) + + test('valueOf', () => { + expect((10).valueOf()).toEqual(10); + expect((-10.2).valueOf()).toEqual(-10.2); + expect((0xf).valueOf()).toEqual(15); + }) + }) } -- GitLab