From f397c884b6551fac3d9f56baf0a8af1fb2abc13a Mon Sep 17 00:00:00 2001 From: duqingquan Date: Mon, 16 Oct 2023 17:44:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EparseInt=20=E6=B5=8B=E8=AF=95?= =?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/Global.uts | 5 +++++ uni_modules/uts-tests/utssdk/KeyWord.uts | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/uni_modules/uts-tests/utssdk/Global.uts b/uni_modules/uts-tests/utssdk/Global.uts index 843b183..8267142 100644 --- a/uni_modules/uts-tests/utssdk/Global.uts +++ b/uni_modules/uts-tests/utssdk/Global.uts @@ -35,6 +35,9 @@ export function testGlobal(): Result { expect(parseInt("9223372036854775807")).toEqual(9.223372036854778e+18) expect(parseInt("9223372036854775807000")).toEqual(9.223372036854777e+21) expect(parseInt("922337203685477580700099999999999999999999999999999999999999999999999999999999999999999")).toEqual(9.223372036854776e+86) + expect(parseInt("50") / 100).toEqual(0.5); + expect(parseInt("500") / 100).toEqual(5); + }) test('parseFloat', () => { @@ -44,6 +47,8 @@ export function testGlobal(): Result { expect(parseFloat("314e-2")).toEqual(3.14); expect(parseFloat("0.0314E+2")).toEqual(3.14); expect(parseFloat("3.14some non-digit characters")).toEqual(3.14); + expect(parseFloat("100") / 50).toEqual(2.0); + }) test('encodeURI', () => { diff --git a/uni_modules/uts-tests/utssdk/KeyWord.uts b/uni_modules/uts-tests/utssdk/KeyWord.uts index b760fca..fe19110 100644 --- a/uni_modules/uts-tests/utssdk/KeyWord.uts +++ b/uni_modules/uts-tests/utssdk/KeyWord.uts @@ -48,6 +48,11 @@ class Parent { } class ChildrenTest extends Parent { + + constructor(weight: number) { + super(weight) + } + override eat(): string { super.eat() return "children instance method" -- GitLab