MCPcopy Create free account
hub / github.com/tendermint/tendermint / TestIsASCIIText

Function TestIsASCIIText

libs/strings/string_test.go:35–48  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33}
34
35func TestIsASCIIText(t *testing.T) {
36 notASCIIText := []string{
37 "", "\xC2", "\xC2\xA2", "\xFF", "\x80", "\xF0", "\n", "\t",
38 }
39 for _, v := range notASCIIText {
40 require.False(t, IsASCIIText(v), "%q is not ascii-text", v)
41 }
42 asciiText := []string{
43 " ", ".", "x", "$", "_", "abcdefg;", "-", "0x00", "0", "123",
44 }
45 for _, v := range asciiText {
46 require.True(t, IsASCIIText(v), "%q is ascii-text", v)
47 }
48}
49
50func TestASCIITrim(t *testing.T) {
51 require.Equal(t, ASCIITrim(" "), "")

Callers

nothing calls this directly

Calls 1

IsASCIITextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…