(t *testing.T)
| 574 | } |
| 575 | |
| 576 | func TestReadComplex128Bytes(t *testing.T) { |
| 577 | var buf bytes.Buffer |
| 578 | en := NewWriter(&buf) |
| 579 | |
| 580 | tests := []complex128{complex(0, 0), complex(12.8, 32.0)} |
| 581 | |
| 582 | for i, v := range tests { |
| 583 | buf.Reset() |
| 584 | en.WriteComplex128(v) |
| 585 | en.Flush() |
| 586 | |
| 587 | out, left, err := ReadComplex128Bytes(buf.Bytes()) |
| 588 | if err != nil { |
| 589 | t.Errorf("test case %d: %s", i, err) |
| 590 | } |
| 591 | if len(left) != 0 { |
| 592 | t.Errorf("expected 0 bytes left; found %d", len(left)) |
| 593 | } |
| 594 | if out != v { |
| 595 | t.Errorf("%f in; %f out", v, out) |
| 596 | } |
| 597 | } |
| 598 | } |
| 599 | |
| 600 | // both the 'str' and 'bin' types are acceptable map keys |
| 601 | func TestReadMapKey(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…