|
@@ -12,18 +12,24 @@ import (
|
|
|
)
|
|
|
|
|
|
func TestExample(t *testing.T) {
|
|
|
- ex := Example{Next: test.ErrorHandler()}
|
|
|
+
|
|
|
+ x := Example{Next: test.ErrorHandler()}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
b := &bytes.Buffer{}
|
|
|
out = b
|
|
|
|
|
|
ctx := context.TODO()
|
|
|
r := new(dns.Msg)
|
|
|
r.SetQuestion("example.org.", dns.TypeA)
|
|
|
+
|
|
|
+
|
|
|
rec := dnstest.NewRecorder(&test.ResponseWriter{})
|
|
|
|
|
|
- ex.ServeDNS(ctx, rec, r)
|
|
|
- if x := b.String(); x != "example" {
|
|
|
- t.Errorf("Failed to print 'example', got %s", x)
|
|
|
+
|
|
|
+ x.ServeDNS(ctx, rec, r)
|
|
|
+ if a := b.String(); a != ex+"\n" {
|
|
|
+ t.Errorf("Failed to print '%s', got %s", ex, a)
|
|
|
}
|
|
|
}
|