From 4d85b7bcdf353c383f60980ba4447692f84ad15d Mon Sep 17 00:00:00 2001 From: duqingquan Date: Tue, 17 Oct 2023 20:29:43 +0800 Subject: [PATCH] =?UTF-8?q?slice=20=E6=96=B0=E5=A2=9E=20=E8=B4=9F=E6=95=B0?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=9A=84=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/String.uts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/uni_modules/uts-tests/utssdk/String.uts b/uni_modules/uts-tests/utssdk/String.uts index e433dd7..7311260 100644 --- a/uni_modules/uts-tests/utssdk/String.uts +++ b/uni_modules/uts-tests/utssdk/String.uts @@ -206,6 +206,10 @@ export function testString(): Result { expect(str6).toEqual("The morning is upon us."); expect("".slice()).toEqual(""); + + expect("abcdefg".slice(-1)).toEqual("g"); + expect("abcdefg".slice(-1,-2)).toEqual(""); + }) test('split', () => { const str = 'The quick brown fox jumps over the lazy dog.'; -- GitLab