From 69a95cc449210db8678d57b9838a619d6c0d96c7 Mon Sep 17 00:00:00 2001 From: duqingquan Date: Fri, 14 Jun 2024 12:18:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85UTSJSONObject=20set-after-get?= =?UTF-8?q?=20=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/UTSJSONObject.uts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/uni_modules/uts-tests/utssdk/UTSJSONObject.uts b/uni_modules/uts-tests/utssdk/UTSJSONObject.uts index c0d12c5..cb4820e 100644 --- a/uni_modules/uts-tests/utssdk/UTSJSONObject.uts +++ b/uni_modules/uts-tests/utssdk/UTSJSONObject.uts @@ -26,6 +26,23 @@ export function testUTSJSONObject() : Result { // #endif }) + test('setvalue-after-get', () => { + let obj = { + "cars":[ + { + name:"car1", + value:100 + } + ] + } + + let cars = obj.getArray("cars") + cars![0].set("value",20) + let firstCar = obj.getJSON("cars[0]") + expect(firstCar!['value']).toEqual(20); + + }) + test('assign-withtype', () => { // #ifdef APP-ANDROID type User = { -- GitLab