(t *testing.T)
| 310 | } |
| 311 | |
| 312 | func TestAppendBytes(t *testing.T) { |
| 313 | sizes := []int{0, 1, 225, int(tuint32)} |
| 314 | var buf bytes.Buffer |
| 315 | en := NewWriter(&buf) |
| 316 | var bts []byte |
| 317 | |
| 318 | for _, sz := range sizes { |
| 319 | buf.Reset() |
| 320 | b := RandBytes(sz) |
| 321 | en.WriteBytes(b) |
| 322 | en.Flush() |
| 323 | bts = AppendBytes(b[0:0], b) |
| 324 | if !bytes.Equal(buf.Bytes(), bts) { |
| 325 | t.Errorf("for bytes of length %d, encoder wrote %d bytes and append wrote %d bytes", sz, buf.Len(), len(bts)) |
| 326 | } |
| 327 | } |
| 328 | } |
| 329 | |
| 330 | func benchappendBytes(size uint32, b *testing.B) { |
| 331 | bts := RandBytes(int(size)) |
nothing calls this directly
no test coverage detected
searching dependent graphs…