aboutsummaryrefslogtreecommitdiff
path: root/middleware/file/wildcard_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'middleware/file/wildcard_test.go')
-rw-r--r--middleware/file/wildcard_test.go73
1 files changed, 4 insertions, 69 deletions
diff --git a/middleware/file/wildcard_test.go b/middleware/file/wildcard_test.go
index 29a6adb33..7f1a2fed3 100644
--- a/middleware/file/wildcard_test.go
+++ b/middleware/file/wildcard_test.go
@@ -1,7 +1,6 @@
package file
import (
- "sort"
"strings"
"testing"
@@ -98,23 +97,7 @@ func TestLookupWildcard(t *testing.T) {
}
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)
}
}
@@ -175,23 +158,7 @@ func TestLookupDoubleWildcard(t *testing.T) {
}
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)
}
}
@@ -246,23 +213,7 @@ func TestLookupApexWildcard(t *testing.T) {
}
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)
}
}
@@ -305,23 +256,7 @@ func TestLookupMultiWildcard(t *testing.T) {
}
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)
}
}