From 68a8bbbd62a261dc1c25db569d106075e30825ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=BA=9A=E7=90=AA?= Date: Fri, 20 Sep 2024 17:37:25 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E5=A2=9E=E5=8A=A0UTSJSONObject?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/uni_modules/uts-tests/utssdk/UTSJSONObject.uts b/uni_modules/uts-tests/utssdk/UTSJSONObject.uts index 1df2475..c2f1cd9 100644 --- a/uni_modules/uts-tests/utssdk/UTSJSONObject.uts +++ b/uni_modules/uts-tests/utssdk/UTSJSONObject.uts @@ -222,5 +222,14 @@ export function testUTSJSONObject() : Result { // #END }) + + test('useless-as', () => { + const obj = { + a: { b: { c: 'c' } } + }; + ((obj["a"] as UTSJSONObject)["b"] as UTSJSONObject)["c"] = "c1" + expect(obj.getString("a.b.c")).toEqual('c1') + + }) }) } \ No newline at end of file -- GitLab