From 171fd526ea94fe7ff44fbeda0df0ff2a866bf2bf Mon Sep 17 00:00:00 2001 From: duqingquan Date: Tue, 18 Jun 2024 17:51:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20isFinite=20=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/uni_modules/uts-tests/utssdk/Number.uts b/uni_modules/uts-tests/utssdk/Number.uts index 0d1103a..5a22aa7 100644 --- a/uni_modules/uts-tests/utssdk/Number.uts +++ b/uni_modules/uts-tests/utssdk/Number.uts @@ -59,6 +59,14 @@ export function testNumber() : Result { expect(isFinite(1000 / 1)).toEqual(true); expect(isFinite(910)).toEqual(true); expect(isFinite(0)).toEqual(true); + + let aj2 = JSON.parse('{"a":1}') as UTSJSONObject; + let aNumber = aj2['a'] as UTSNumber + expect(isFinite(aNumber)).toEqual(true); + expect(UTSNumber.isFinite(aNumber)).toEqual(true); + expect(UTSNumber.isFinite(11.00)).toEqual(true); + expect(UTSNumber.isFinite(Double.POSITIVE_INFINITY)).toEqual(false); + }) test('number-from-json-parse', () => { -- GitLab