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

Function TestResolveAddr_NoCacheMode

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

Source from the content-addressed store, hash-verified

72}
73
74func TestResolveAddr_NoCacheMode(t *testing.T) {
75 r := New(100 * time.Millisecond)
76 r.SetNoCache(true)
77
78 addr := "127.0.0.1"
79 r.ResolveAddr(addr)
80
81 // cache should remain empty when noCache is enabled
82 if r.GetCacheSize() != 0 {
83 t.Errorf("expected cache size 0 with noCache, got %d", r.GetCacheSize())
84 }
85}
86
87func TestResolvePort_Zero(t *testing.T) {
88 r := New(100 * time.Millisecond)

Callers

nothing calls this directly

Calls 4

SetNoCacheMethod · 0.80
ResolveAddrMethod · 0.80
GetCacheSizeMethod · 0.80
NewFunction · 0.70

Tested by

no test coverage detected