Skip to content

Commit

Permalink
✅ Add a test case TestRemoveZeroWidthCharacters
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Dec 4, 2024
1 parent 1ae6a98 commit 41a8094
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions string_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 41a8094

Please sign in to comment.