MCPcopy Create free account
hub / github.com/evilsocket/sum / TestWrappedRecordsFind

Function TestWrappedRecordsFind

wrapper/records_test.go:107–125  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

105}
106
107func TestWrappedRecordsFind(t *testing.T) {
108 setupRecords(t, true)
109 defer teardownRecords(t)
110
111 records, err := storage.LoadRecords(testFolder)
112 if err != nil {
113 t.Fatal(err)
114 }
115
116 wrapped := WrapRecords(records)
117 for i := 0; i < testRecords; i++ {
118 id := uint64(i + 1)
119 if r := wrapped.Find(id); r.IsNull() {
120 t.Fatalf("wrapped record with id %d not found", id)
121 } else if r.ID != id {
122 t.Fatalf("expected record with id %d, found %d", id, r.ID)
123 }
124 }
125}
126
127func TestWrappedRecordsFindWithInvalidId(t *testing.T) {
128 setupRecords(t, false)

Callers

nothing calls this directly

Calls 5

WrapRecordsFunction · 0.85
IsNullMethod · 0.80
setupRecordsFunction · 0.70
teardownRecordsFunction · 0.70
FindMethod · 0.45

Tested by

no test coverage detected