MCPcopy Index your code
hub / github.com/golang/groupcache / TestCaching

Function TestCaching

groupcache_test.go:174–187  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

172}
173
174func TestCaching(t *testing.T) {
175 once.Do(testSetup)
176 fills := countFills(func() {
177 for i := 0; i < 10; i++ {
178 var s string
179 if err := stringGroup.Get(dummyCtx, "TestCaching-key", StringSink(&s)); err != nil {
180 t.Fatal(err)
181 }
182 }
183 })
184 if fills != 1 {
185 t.Errorf("expected 1 cache fill; got %d", fills)
186 }
187}
188
189func TestCacheEviction(t *testing.T) {
190 once.Do(testSetup)

Callers

nothing calls this directly

Calls 4

countFillsFunction · 0.85
StringSinkFunction · 0.85
DoMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…