MCPcopy
hub / github.com/perkeep/perkeep / check

Function check

pkg/sorted/buffer/buffer_test.go:87–104  ·  view source on GitHub ↗
(t *testing.T, kv sorted.KeyValue, prefix string, want []mod)

Source from the content-addressed store, hash-verified

85}
86
87func check(t *testing.T, kv sorted.KeyValue, prefix string, want []mod) {
88 it := kv.Find("", "")
89 for i, m := range want {
90 if !it.Next() {
91 t.Fatalf("%v: unexpected it.Next == false on iteration %d", prefix, i)
92 }
93 if k, v := it.Key(), it.Value(); k != m.key || v != m.value {
94 t.Errorf("%v: got key == %q value == %q, want key == %q value == %q on iteration %d",
95 prefix, k, v, m.key, m.value, i)
96 }
97 }
98 if it.Next() {
99 t.Errorf("%v: unexpected it.Next == true after complete iteration", prefix)
100 }
101 if err := it.Close(); err != nil {
102 t.Errorf("%v: error closing iterator: %v", prefix, err)
103 }
104}

Callers 3

TestBufferFunction · 0.70
TestWebsocketQueryFunction · 0.50
TestSymlinkFunction · 0.50

Calls 6

FindMethod · 0.65
NextMethod · 0.65
FatalfMethod · 0.65
KeyMethod · 0.65
ValueMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected