(t *testing.T)
| 30 | } |
| 31 | |
| 32 | func 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 | |
| 46 | func TestEncodeNonASCIIString(t *testing.T) { |
| 47 | s := "hello\x80world" |
nothing calls this directly
no test coverage detected