MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / TestKVIPList_CountItems

Function TestKVIPList_CountItems

internal/iplibrary/ip_list_kv_test.go:187–210  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

185}
186
187func TestKVIPList_CountItems(t *testing.T) {
188 kv, err := iplibrary.NewKVIPList()
189 if err != nil {
190 t.Fatal(err)
191 }
192
193 var count int
194 var m = map[int64]zero.Zero{}
195 for {
196 items, goNext, readErr := kv.ReadItems(0, 1000)
197 if readErr != nil {
198 t.Fatal(readErr)
199 }
200 for _, item := range items {
201 count++
202 m[item.Id] = zero.Zero{}
203 }
204
205 if !goNext {
206 break
207 }
208 }
209 t.Log("count:", count, "len:", len(m))
210}
211
212func TestKVIPList_Inspect(t *testing.T) {
213 kv, err := iplibrary.NewKVIPList()

Callers

nothing calls this directly

Calls 3

ReadItemsMethod · 0.95
NewKVIPListFunction · 0.92
LogMethod · 0.80

Tested by

no test coverage detected