(t *testing.T)
| 6 | ) |
| 7 | |
| 8 | func TestEncodeDecode(t *testing.T) { |
| 9 | // given |
| 10 | now := uint64(time.Now().Unix()) |
| 11 | hash := uint64(42) |
| 12 | key := "key" |
| 13 | data := []byte("data") |
| 14 | buffer := make([]byte, 100) |
| 15 | |
| 16 | // when |
| 17 | wrapped := wrapEntry(now, hash, key, data, &buffer) |
| 18 | |
| 19 | // then |
| 20 | assertEqual(t, key, readKeyFromEntry(wrapped)) |
| 21 | assertEqual(t, hash, readHashFromEntry(wrapped)) |
| 22 | assertEqual(t, now, readTimestampFromEntry(wrapped)) |
| 23 | assertEqual(t, data, readEntry(wrapped)) |
| 24 | assertEqual(t, 100, len(buffer)) |
| 25 | } |
| 26 | |
| 27 | func TestAllocateBiggerBuffer(t *testing.T) { |
| 28 | //given |
nothing calls this directly
no test coverage detected
searching dependent graphs…