blob: 85df7d672d1715e57bee495ab01e0554f3e55b03 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
package any
import (
"context"
"testing"
"github.com/coredns/coredns/plugin/pkg/dnstest"
"github.com/coredns/coredns/plugin/test"
"github.com/miekg/dns"
)
func TestAny(t *testing.T) {
req := new(dns.Msg)
req.SetQuestion("example.org.", dns.TypeANY)
a := &Any{}
rec := dnstest.NewRecorder(&test.ResponseWriter{})
_, err := a.ServeDNS(context.TODO(), rec, req)
if err != nil {
t.Errorf("Expected no error, but got %q", err)
}
if rec.Msg.Answer[0].(*dns.HINFO).Cpu != "ANY obsoleted" {
t.Errorf("Expected HINFO, but got %q", rec.Msg.Answer[0].(*dns.HINFO).Cpu)
}
}
|