MCPcopy
hub / github.com/coredns/coredns / TestFormErr

Function TestFormErr

plugin/cache/error_test.go:14–27  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestFormErr(t *testing.T) {
15 c := New()
16 c.Next = formErrHandler()
17
18 req := new(dns.Msg)
19 req.SetQuestion("example.org.", dns.TypeA)
20 rec := dnstest.NewRecorder(&test.ResponseWriter{})
21
22 c.ServeDNS(context.TODO(), rec, req)
23
24 if c.pcache.Len() != 0 {
25 t.Errorf("Cached %s, while reply had %d", "example.org.", rec.Msg.Rcode)
26 }
27}
28
29// formErrHandler is a fake plugin implementation which returns a FORMERR for a reply.
30func formErrHandler() plugin.Handler {

Callers

nothing calls this directly

Calls 6

NewRecorderFunction · 0.92
formErrHandlerFunction · 0.85
NewFunction · 0.70
ServeDNSMethod · 0.65
ErrorfMethod · 0.65
LenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…