MCPcopy Create free account
hub / github.com/akalin/gopar / TestEncodeASCIIString

Function TestEncodeASCIIString

par2/string_test.go:32–44  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

30}
31
32func TestEncodeASCIIString(t *testing.T) {
33 strings := []string{
34 "hello world",
35 "hello\nworld",
36 "\x01\x7f",
37 }
38
39 for _, s := range strings {
40 bs, err := encodeASCIIString(s)
41 require.NoError(t, err)
42 require.Equal(t, []byte(s), bs)
43 }
44}
45
46func TestEncodeNonASCIIString(t *testing.T) {
47 s := "hello\x80world"

Callers

nothing calls this directly

Calls 1

encodeASCIIStringFunction · 0.85

Tested by

no test coverage detected