From 751f144d94a9b76c9c18e57ebd8c829a6e6c42a8 Mon Sep 17 00:00:00 2001 From: m0_75226990 Date: Fri, 13 Dec 2024 12:23:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=B5=8B=E8=AF=95=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit b9c55f15910c60e753f0a5a50fbbc23370b3f890) --- uni_modules/uts-tests/utssdk/String.uts | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/uni_modules/uts-tests/utssdk/String.uts b/uni_modules/uts-tests/utssdk/String.uts index 6326fa0..61bfa6d 100644 --- a/uni_modules/uts-tests/utssdk/String.uts +++ b/uni_modules/uts-tests/utssdk/String.uts @@ -600,16 +600,32 @@ export function testString() : Result { c: 'collapse' } let b:string = `fdsfa${visibilitylist['n']}` + // #ifdef APP-ANDROID expect(b).toEqual("fdsfanull"); + // #endif + // TODO: 需要编译器协助调用自定义函数将nil转成null + // #ifdef APP-IOS + expect(b).toEqual("fdsfanil"); + // #endif let a:Number|null = null let ab:string = `aaa${a}` + // #ifdef APP-ANDROID expect(ab).toEqual("aaanull"); + // #endif + // #ifdef APP-IOS + expect(ab).toEqual("aaanil"); + // #endif - let c:Any|null = "123" - c = null + // let c:Any|null = "123" + // c = null let ac:string = `ccc${a}` + // #ifdef APP-ANDROID expect(ac).toEqual("cccnull"); + // #endif + // #ifdef APP-IOS + expect(ac).toEqual("cccnil"); + // #endif }) test("matchAll", () => { -- GitLab