(t *testing.T)
| 224 | } |
| 225 | |
| 226 | func TestVarstrListWithEOF(t *testing.T) { |
| 227 | var buf bytes.Buffer |
| 228 | WriteVarint31(&buf, 3) |
| 229 | WriteVarstr31(&buf, []byte{0x01}) |
| 230 | WriteVarstr31(&buf, []byte{0x02}) |
| 231 | WriteVarstr31(&buf, []byte{0x03}) |
| 232 | |
| 233 | want := [][]byte{[]byte{0x01}, []byte{0x02}, []byte{0x03}} |
| 234 | got, err := ReadVarstrList(NewReader(buf.Bytes())) |
| 235 | if !reflect.DeepEqual(got, want) { |
| 236 | t.Errorf("got %#v, want %#v", got, want) |
| 237 | } |
| 238 | if err != nil && err != io.EOF { |
| 239 | t.Errorf("got %s want nil or io.EOF", err) |
| 240 | } |
| 241 | } |
| 242 | |
| 243 | // TestTooLongVarstrList tests decoding a VarstrList that has a leading |
| 244 | // element count much longer than the actual list. Reading such a |
nothing calls this directly
no test coverage detected