From dd9934448daf1c16c089ac15dd047b8f86a7f043 Mon Sep 17 00:00:00 2001 From: duqingquan Date: Tue, 18 Jun 2024 17:46:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=20UTSNumber=20isNaN=20?= =?UTF-8?q?=E6=B5=8B=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 8919e3a..0d1103a 100644 --- a/uni_modules/uts-tests/utssdk/Number.uts +++ b/uni_modules/uts-tests/utssdk/Number.uts @@ -114,6 +114,14 @@ export function testNumber() : Result { test('isNaN', () => { expect(isNaN(0)).toEqual(false); + + let aj2 = JSON.parse('{"a":1}') as UTSJSONObject; + let aNumber = aj2['a'] as UTSNumber + expect(isNaN(aNumber)).toEqual(false); + expect(UTSNumber.isNaN(aNumber)).toEqual(false); + expect(UTSNumber.isNaN(11)).toEqual(false); + expect(UTSNumber.isNaN(null)).toEqual(false); + expect(UTSNumber.isNaN(1 / 0)).toEqual(false); }) test('toPrecision', () => { -- GitLab