(t *testing.T)
| 503 | } |
| 504 | |
| 505 | func TestReadZCBytes(t *testing.T) { |
| 506 | var buf bytes.Buffer |
| 507 | en := NewWriter(&buf) |
| 508 | |
| 509 | tests := [][]byte{{}, []byte("some bytes"), []byte("some more bytes")} |
| 510 | |
| 511 | for i, v := range tests { |
| 512 | buf.Reset() |
| 513 | en.WriteBytes(v) |
| 514 | en.Flush() |
| 515 | out, left, err := ReadBytesZC(buf.Bytes()) |
| 516 | if err != nil { |
| 517 | t.Errorf("test case %d: %s", i, err) |
| 518 | } |
| 519 | if len(left) != 0 { |
| 520 | t.Errorf("expected 0 bytes left; found %d", len(left)) |
| 521 | } |
| 522 | if !bytes.Equal(out, v) { |
| 523 | t.Errorf("%q in; %q out", v, out) |
| 524 | } |
| 525 | } |
| 526 | } |
| 527 | |
| 528 | func TestReadZCString(t *testing.T) { |
| 529 | var buf bytes.Buffer |
nothing calls this directly
no test coverage detected
searching dependent graphs…