1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-09 07:02:29 +08:00

feat: add IsPrintable

This commit is contained in:
dudaodong
2023-03-31 12:00:32 +08:00
parent 217350042b
commit bc25e7a037
5 changed files with 132 additions and 3 deletions

View File

@@ -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"))
}