From 222e21620474f7a4e81ef01597ff9d4e3bd3817d Mon Sep 17 00:00:00 2001 From: duqingquan Date: Fri, 13 Dec 2024 11:55:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=20null=20=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E5=AD=97=E7=AC=A6=E4=B8=B2=20toString?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- uni_modules/uts-tests/utssdk/String.uts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/uni_modules/uts-tests/utssdk/String.uts b/uni_modules/uts-tests/utssdk/String.uts index d5911c3..feda927 100644 --- a/uni_modules/uts-tests/utssdk/String.uts +++ b/uni_modules/uts-tests/utssdk/String.uts @@ -595,6 +595,25 @@ export function testString() : Result { expect(str1.startsWith("not to be", 10)).toEqual(true); expect(str1.startsWith("not to be", 8)).toEqual(false); }) + test("toStringNullTest1", () => { + const visibilitylist = { + v: 'visible', + h: 'hidden', + c: 'collapse' + } + let b:string = `fdsfa${visibilitylist['n']}` + expect(b).toEqual("fdsfanull"); + + let a:Number|null = null + let ab:string = `aaa${a}` + expect(ab).toEqual("aaanull"); + + let c:Any|null = "123" + c = null + let ac:string = `ccc${a}` + expect(ac).toEqual("cccnull"); + + }) test("matchAll", () => { // const reg = /t(e)(st(\d?))/g; // const str = 'test1test2'; -- GitLab