diff options
Diffstat (limited to 'request/request_test.go')
-rw-r--r-- | request/request_test.go | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/request/request_test.go b/request/request_test.go index cad2dce0d..6685ad3b3 100644 --- a/request/request_test.go +++ b/request/request_test.go @@ -73,10 +73,7 @@ func TestRequestScrubAnswer(t *testing.T) { fmt.Sprintf("large.example.com. 10 IN SRV 0 0 80 10-0-0-%d.default.pod.k8s.example.com.", i))) } - _, got := req.Scrub(reply) - if want := ScrubAnswer; want != got { - t.Errorf("Want scrub result %d, got %d", want, got) - } + req.scrub(reply) if want, got := req.Size(), reply.Len(); want < got { t.Errorf("Want scrub to reduce message length below %d bytes, got %d bytes", want, got) } @@ -97,10 +94,7 @@ func TestRequestScrubExtra(t *testing.T) { fmt.Sprintf("large.example.com. 10 IN SRV 0 0 80 10-0-0-%d.default.pod.k8s.example.com.", i))) } - _, got := req.Scrub(reply) - if want := ScrubExtra; want != got { - t.Errorf("Want scrub result %d, got %d", want, got) - } + req.scrub(reply) if want, got := req.Size(), reply.Len(); want < got { t.Errorf("Want scrub to reduce message length below %d bytes, got %d bytes", want, got) } @@ -122,10 +116,7 @@ func TestRequestScrubExtraEdns0(t *testing.T) { fmt.Sprintf("large.example.com. 10 IN SRV 0 0 80 10-0-0-%d.default.pod.k8s.example.com.", i))) } - _, got := req.Scrub(reply) - if want := ScrubExtra; want != got { - t.Errorf("Want scrub result %d, got %d", want, got) - } + req.scrub(reply) if want, got := req.Size(), reply.Len(); want < got { t.Errorf("Want scrub to reduce message length below %d bytes, got %d bytes", want, got) } @@ -155,10 +146,7 @@ func TestRequestScrubExtraRegression(t *testing.T) { fmt.Sprintf("10-0-0-%d.default.pod.k8s.example.com. 10 IN A 10.0.0.%d", i, i))) } - _, got := req.Scrub(reply) - if want := ScrubExtra; want != got { - t.Errorf("Want scrub result %d, got %d", want, got) - } + reply = req.scrub(reply) if want, got := req.Size(), reply.Len(); want < got { t.Errorf("Want scrub to reduce message length below %d bytes, got %d bytes", want, got) } @@ -183,10 +171,7 @@ func TestRequestScrubAnswerExact(t *testing.T) { reply.Answer = append(reply.Answer, test.A(fmt.Sprintf("large.example.com. 10 IN A 127.0.0.%d", i))) } - _, got := req.Scrub(reply) - if want := ScrubAnswer; want != got { - t.Errorf("Want scrub result %d, got %d", want, got) - } + req.scrub(reply) if want, got := req.Size(), reply.Len(); want < got { t.Errorf("Want scrub to reduce message length below %d bytes, got %d bytes", want, got) } |