(t *testing.T)
| 550 | } |
| 551 | |
| 552 | func TestReadStringBytes(t *testing.T) { |
| 553 | var buf bytes.Buffer |
| 554 | en := NewWriter(&buf) |
| 555 | |
| 556 | tests := []string{"", "hello", "here's another string......"} |
| 557 | |
| 558 | for i, v := range tests { |
| 559 | buf.Reset() |
| 560 | en.WriteString(v) |
| 561 | en.Flush() |
| 562 | |
| 563 | out, left, err := ReadStringBytes(buf.Bytes()) |
| 564 | if err != nil { |
| 565 | t.Errorf("test case %d: %s", i, err) |
| 566 | } |
| 567 | if len(left) != 0 { |
| 568 | t.Errorf("expected 0 bytes left; found %d", len(left)) |
| 569 | } |
| 570 | if out != v { |
| 571 | t.Errorf("%q in; %q out", v, out) |
| 572 | } |
| 573 | } |
| 574 | } |
| 575 | |
| 576 | func TestReadComplex128Bytes(t *testing.T) { |
| 577 | var buf bytes.Buffer |
nothing calls this directly
no test coverage detected
searching dependent graphs…