(t *testing.T)
| 660 | } |
| 661 | |
| 662 | func TestReadTimeBytes(t *testing.T) { |
| 663 | var buf bytes.Buffer |
| 664 | en := NewWriter(&buf) |
| 665 | |
| 666 | now := time.Now() |
| 667 | en.WriteTime(now) |
| 668 | en.Flush() |
| 669 | out, left, err := ReadTimeBytes(buf.Bytes()) |
| 670 | if err != nil { |
| 671 | t.Fatal(err) |
| 672 | } |
| 673 | |
| 674 | if len(left) != 0 { |
| 675 | t.Errorf("expected 0 bytes left; found %d", len(left)) |
| 676 | } |
| 677 | if !now.Equal(out) { |
| 678 | t.Errorf("%s in; %s out", now, out) |
| 679 | } |
| 680 | } |
| 681 | |
| 682 | func BenchmarkReadTimeBytes(b *testing.B) { |
| 683 | data := AppendTime(nil, time.Now()) |
nothing calls this directly
no test coverage detected
searching dependent graphs…