(t *testing.T)
| 479 | } |
| 480 | |
| 481 | func TestReadBytesBytes(t *testing.T) { |
| 482 | var buf bytes.Buffer |
| 483 | en := NewWriter(&buf) |
| 484 | |
| 485 | tests := [][]byte{{}, []byte("some bytes"), []byte("some more bytes")} |
| 486 | var scratch []byte |
| 487 | |
| 488 | for i, v := range tests { |
| 489 | buf.Reset() |
| 490 | en.WriteBytes(v) |
| 491 | en.Flush() |
| 492 | out, left, err := ReadBytesBytes(buf.Bytes(), scratch) |
| 493 | if err != nil { |
| 494 | t.Errorf("test case %d: %s", i, err) |
| 495 | } |
| 496 | if len(left) != 0 { |
| 497 | t.Errorf("expected 0 bytes left; found %d", len(left)) |
| 498 | } |
| 499 | if !bytes.Equal(out, v) { |
| 500 | t.Errorf("%q in; %q out", v, out) |
| 501 | } |
| 502 | } |
| 503 | } |
| 504 | |
| 505 | func TestReadZCBytes(t *testing.T) { |
| 506 | var buf bytes.Buffer |
nothing calls this directly
no test coverage detected
searching dependent graphs…