diff options
Diffstat (limited to 'middleware/etcd/debug_test.go')
-rw-r--r-- | middleware/etcd/debug_test.go | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/middleware/etcd/debug_test.go b/middleware/etcd/debug_test.go index 65e503d6a..ccb06fa68 100644 --- a/middleware/etcd/debug_test.go +++ b/middleware/etcd/debug_test.go @@ -3,7 +3,6 @@ package etcd import ( - "sort" "testing" "github.com/coredns/coredns/middleware/etcd/msg" @@ -29,23 +28,7 @@ func TestDebugLookup(t *testing.T) { etc.ServeDNS(ctxt, rec, m) resp := rec.Msg - sort.Sort(test.RRSet(resp.Answer)) - sort.Sort(test.RRSet(resp.Ns)) - sort.Sort(test.RRSet(resp.Extra)) - - if !test.Header(t, tc, resp) { - t.Logf("%v\n", resp) - continue - } - if !test.Section(t, tc, test.Answer, resp.Answer) { - t.Logf("%v\n", resp) - } - if !test.Section(t, tc, test.Ns, resp.Ns) { - t.Logf("%v\n", resp) - } - if !test.Section(t, tc, test.Extra, resp.Extra) { - t.Logf("%v\n", resp) - } + test.SortAndCheck(t, resp, tc) } } @@ -63,23 +46,7 @@ func TestDebugLookupFalse(t *testing.T) { etc.ServeDNS(ctxt, rec, m) resp := rec.Msg - sort.Sort(test.RRSet(resp.Answer)) - sort.Sort(test.RRSet(resp.Ns)) - sort.Sort(test.RRSet(resp.Extra)) - - if !test.Header(t, tc, resp) { - t.Logf("%v\n", resp) - continue - } - if !test.Section(t, tc, test.Answer, resp.Answer) { - t.Logf("%v\n", resp) - } - if !test.Section(t, tc, test.Ns, resp.Ns) { - t.Logf("%v\n", resp) - } - if !test.Section(t, tc, test.Extra, resp.Extra) { - t.Logf("%v\n", resp) - } + test.SortAndCheck(t, resp, tc) } } |