MCPcopy
hub / github.com/karol-broda/snitch / TestGetCacheSize

Function TestGetCacheSize

internal/resolver/resolver_test.go:166–177  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

164}
165
166func TestGetCacheSize(t *testing.T) {
167 r := New(100 * time.Millisecond)
168
169 if r.GetCacheSize() != 0 {
170 t.Errorf("expected initial cache size 0, got %d", r.GetCacheSize())
171 }
172
173 r.ResolveAddr("127.0.0.1")
174 if r.GetCacheSize() != 1 {
175 t.Errorf("expected cache size 1, got %d", r.GetCacheSize())
176 }
177}
178
179func TestGetServiceName(t *testing.T) {
180 tests := []struct {

Callers

nothing calls this directly

Calls 3

GetCacheSizeMethod · 0.80
ResolveAddrMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected