(t *testing.T, found, expected []memoryRecord)
| 140 | } |
| 141 | |
| 142 | func assertRecords(t *testing.T, found, expected []memoryRecord) { |
| 143 | t.Helper() |
| 144 | i := 0 |
| 145 | |
| 146 | for i < len(found) && i < len(expected) { |
| 147 | r1 := found[i] |
| 148 | r2 := expected[i] |
| 149 | |
| 150 | if !reflect.DeepEqual(r1, r2) { |
| 151 | t.Errorf("records at index %d don't match", i) |
| 152 | t.Logf("expected:\n%#v", r2) |
| 153 | t.Logf("found:\n%#v", r1) |
| 154 | } |
| 155 | |
| 156 | i++ |
| 157 | } |
| 158 | |
| 159 | for i < len(found) { |
| 160 | t.Errorf("unexpected record at index %d:\n%+v", i, found[i]) |
| 161 | i++ |
| 162 | } |
| 163 | |
| 164 | for i < len(expected) { |
| 165 | t.Errorf("missing record at index %d:\n%+v", i, expected[i]) |
| 166 | i++ |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | func readRecords(records RecordReader) ([]memoryRecord, error) { |
| 171 | list := []memoryRecord{} |
no outgoing calls
no test coverage detected