(b *testing.B)
| 457 | } |
| 458 | |
| 459 | func BenchmarkReadString(b *testing.B) { |
| 460 | const n = 32 << 10 |
| 461 | |
| 462 | data := make([]byte, n) |
| 463 | data[n-1] = 'x' |
| 464 | b.SetBytes(int64(n)) |
| 465 | for i := 0; i < b.N; i++ { |
| 466 | buf := NewBuffer(data) |
| 467 | _, err := buf.ReadString('x') |
| 468 | if err != nil { |
| 469 | b.Fatal(err) |
| 470 | } |
| 471 | } |
| 472 | } |
| 473 | |
| 474 | func TestGrow(t *testing.T) { |
| 475 | x := []byte{'x'} |
nothing calls this directly
no test coverage detected