mirror of
https://github.com/duke-git/lancet.git
synced 2026-11-16 05:12:11 +08:00
fix(strutil): encode default trim characters as runes (#369)
This commit is contained in:
1 parent
33a7e5bf6d
commit
145959ee62
2 files changed
+7
-1
No files matched your search
@@ -686,6 +686,12 @@ func TestReplaceWithMap(t *testing.T) {
|
||||
|
||||
func TestTrim(t *testing.T) {
|
||||
t.Parallel()
|
||||
if got := Trim("\u0085\u00a0value\u00a0\u0085"); got != "value" {
|
||||
t.Errorf("Trim Unicode whitespace = %q, want value", got)
|
||||
}
|
||||
if got := Trim("\ufffdvalue\ufffd"); got != "\ufffdvalue\ufffd" {
|
||||
t.Errorf("Trim removed replacement characters: %q", got)
|
||||
}
|
||||
|
||||
assert := internal.NewAssert(t, "TestTrim")
|
||||
|
||||
|
||||
Reference in new issue
Block a user