(t *testing.T)
| 35 | } |
| 36 | |
| 37 | func TestRecordReader(t *testing.T) { |
| 38 | now := time.Now() |
| 39 | |
| 40 | records := []memoryRecord{ |
| 41 | { |
| 42 | offset: 1, |
| 43 | time: now, |
| 44 | key: []byte("key-1"), |
| 45 | }, |
| 46 | { |
| 47 | offset: 2, |
| 48 | time: now.Add(time.Millisecond), |
| 49 | value: []byte("value-1"), |
| 50 | }, |
| 51 | { |
| 52 | offset: 3, |
| 53 | time: now.Add(time.Second), |
| 54 | key: []byte("key-3"), |
| 55 | value: []byte("value-3"), |
| 56 | headers: []Header{ |
| 57 | {Key: "answer", Value: []byte("42")}, |
| 58 | }, |
| 59 | }, |
| 60 | } |
| 61 | |
| 62 | r1 := NewRecordReader(makeRecords(records)...) |
| 63 | r2 := NewRecordReader(makeRecords(records)...) |
| 64 | assertRecords(t, r1, r2) |
| 65 | } |
| 66 | |
| 67 | func TestMultiRecordReader(t *testing.T) { |
| 68 | now := time.Now() |
nothing calls this directly
no test coverage detected