MCPcopy Index your code
hub / github.com/google/codesearch / TestHeap

Function TestHeap

index/write_test.go:167–181  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

165}
166
167func TestHeap(t *testing.T) {
168 h := &postHeap{}
169 es := []postEntry{7, 4, 3, 2, 4}
170 for _, e := range es {
171 h.addMem([]postEntry{e})
172 }
173 if len(h.ch) != len(es) {
174 t.Fatalf("wrong heap size: %d, want %d", len(h.ch), len(es))
175 }
176 for a, b := h.next(), h.next(); b.trigram() != (1<<24 - 1); a, b = b, h.next() {
177 if a > b {
178 t.Fatalf("%d should <= %d", a, b)
179 }
180 }
181}

Callers

nothing calls this directly

Calls 3

addMemMethod · 0.95
nextMethod · 0.95
trigramMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…