From 5d65e91fd26f75bd4c8e5d12dc5c2ea2ea678050 Mon Sep 17 00:00:00 2001 From: duqingquan Date: Thu, 11 Jul 2024 19:28:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0UTSJSONObject.assign=20?= =?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/UTSJSONObject.uts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/uni_modules/uts-tests/utssdk/UTSJSONObject.uts b/uni_modules/uts-tests/utssdk/UTSJSONObject.uts index f9a2082..d64bda1 100644 --- a/uni_modules/uts-tests/utssdk/UTSJSONObject.uts +++ b/uni_modules/uts-tests/utssdk/UTSJSONObject.uts @@ -22,7 +22,19 @@ export function testUTSJSONObject() : Result { const returnedTarget = UTSJSONObject.assign(target, source); expect(returnedTarget.toMap().size).toEqual(3); - console.log(returnedTarget) + + type A = { + username:"张三", + age:12 + } + type C = { + work:0.001 + } + let b = UTSJSONObject.assign(new A("张三",12),{b:2},new C(0.002)) + expect(b['age']).toEqual(12); + expect(b['username']).toEqual("张三"); + expect(b['b']).toEqual(2); + expect(b['work']).toEqual(0.002); // #endif }) -- GitLab