From 41a80944e13ddfebf1d972a2e98644a4f3659d89 Mon Sep 17 00:00:00 2001 From: Daniel <845765@qq.com> Date: Wed, 4 Dec 2024 20:16:47 +0800 Subject: [PATCH] :white_check_mark: Add a test case TestRemoveZeroWidthCharacters --- string_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/string_test.go b/string_test.go index 9fc66e4..1161a47 100644 --- a/string_test.go +++ b/string_test.go @@ -115,6 +115,15 @@ func TestRemoveInvisible(t *testing.T) { } } +func TestRemoveZeroWidthCharacters(t *testing.T) { + expected := "foobarbaz" + got := Str.RemoveZeroWidthCharacters("foo\u200bbar​baz\u200C") + if expected != got { + t.Errorf("expected [%s], got [%s]", expected, got) + return + } +} + func TestRemoveCtl(t *testing.T) { expected := "foo测试barbaz" got := Str.RemoveCtl("foo\u200b测试\uE004\nbar\tbaz")