(t *testing.T)
| 12 | ) |
| 13 | |
| 14 | func 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. |
| 30 | func formErrHandler() plugin.Handler { |
nothing calls this directly
no test coverage detected
searching dependent graphs…