(t *testing.T)
| 143 | } |
| 144 | |
| 145 | func TestWrappedRecordsAll(t *testing.T) { |
| 146 | setupRecords(t, true) |
| 147 | defer teardownRecords(t) |
| 148 | |
| 149 | records, err := storage.LoadRecords(testFolder) |
| 150 | if err != nil { |
| 151 | t.Fatal(err) |
| 152 | } |
| 153 | |
| 154 | wrapped := WrapRecords(records) |
| 155 | all := wrapped.All() |
| 156 | if len(all) != testRecords { |
| 157 | t.Fatalf("expected %d wrapped records, got %d", testRecords, len(all)) |
| 158 | } |
| 159 | |
| 160 | for _, wRec := range all { |
| 161 | err := records.ForEach(func(m proto.Message) error { |
| 162 | if reflect.DeepEqual(m.(*pb.Record), wRec.record) { |
| 163 | return errFound |
| 164 | } |
| 165 | return nil |
| 166 | }) |
| 167 | if err != errFound { |
| 168 | t.Fatalf("record %d not wrapped correctly", wRec.ID) |
| 169 | } |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | func TestWrappedRecordsAllBut(t *testing.T) { |
| 174 | setupRecords(t, true) |
nothing calls this directly
no test coverage detected