(t *testing.T)
| 8 | ) |
| 9 | |
| 10 | func TestDecodeASCIIString(t *testing.T) { |
| 11 | strings := []string{ |
| 12 | "hello world", |
| 13 | "hello\nworld", |
| 14 | "\x01\x7f", |
| 15 | } |
| 16 | |
| 17 | for _, s := range strings { |
| 18 | require.Equal(t, s, decodeNullPaddedASCIIString([]byte(s))) |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | func TestDecodeASCIIStringNullByte(t *testing.T) { |
| 23 | s := "hello\x00world" |
nothing calls this directly
no test coverage detected