From 03a3982d875e9bcb22d01179ff84b156ad95e171 Mon Sep 17 00:00:00 2001 From: duqingquan Date: Wed, 25 Sep 2024 17:05:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20UTSJSONObject=20=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E4=B8=8D=E5=AD=98=E5=9C=A8=E5=B1=9E=E6=80=A7=E6=97=B6?= =?UTF-8?q?=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uni_modules/uts-tests/utssdk/UTSJSONObject.uts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/uni_modules/uts-tests/utssdk/UTSJSONObject.uts b/uni_modules/uts-tests/utssdk/UTSJSONObject.uts index 8b870e1..b1a8962 100644 --- a/uni_modules/uts-tests/utssdk/UTSJSONObject.uts +++ b/uni_modules/uts-tests/utssdk/UTSJSONObject.uts @@ -89,6 +89,16 @@ export function testUTSJSONObject() : Result { // #endif }) + test('get-no-exist-value', () => { + // #ifdef APP-ANDROID + let test = { + qq:[11,22] + } + expect(test.getNumber("qq[2]")).toEqual(null); + expect(test.getNumber("qq[2]",999)).toEqual(999); + + // #endif + }) test('setvalue-after-get', () => { // #ifdef APP-ANDROID // #TEST UTSJSONObject.getJSON,UTSJSONObject.getArray -- GitLab