mirror of
https://github.com/duke-git/lancet.git
synced 2026-11-16 05:12:11 +08:00
feat: add IsPrintable
This commit is contained in:
1 parent
217350042b
commit
bc25e7a037
5 files changed
+132
-3
No files matched your search
@@ -411,3 +411,13 @@ func TestIsASCII(t *testing.T) {
|
||||
assert.Equal(false, IsASCII("😄"))
|
||||
assert.Equal(false, IsASCII("你好"))
|
||||
}
|
||||
|
||||
func TestIsPrintable(t *testing.T) {
|
||||
assert := internal.NewAssert(t, "TestIsPrintable")
|
||||
|
||||
assert.Equal(true, IsPrintable("ABC"))
|
||||
assert.Equal(true, IsPrintable("{id: 123}"))
|
||||
assert.Equal(true, IsPrintable(""))
|
||||
assert.Equal(true, IsPrintable("😄"))
|
||||
assert.Equal(false, IsPrintable("\u0000"))
|
||||
}
|
||||
Reference in new issue
Block a user