fix: Print response body on failure if debug is set to true

This commit is contained in:
TwiN
2023-03-14 20:02:31 -04:00
parent f8f61deb2c
commit 038c8c8d8e
8 changed files with 78 additions and 84 deletions

View File

@ -90,12 +90,12 @@ func TestIntegrationQuery(t *testing.T) {
}
if test.inputDNS.QueryType == "NS" {
// Because there are often multiple nameservers backing a single domain, we'll only look at the suffix
if !pattern.Match(test.expectedBody, string(result.body)) {
t.Errorf("got %s, expected result %s,", string(result.body), test.expectedBody)
if !pattern.Match(test.expectedBody, string(result.Body)) {
t.Errorf("got %s, expected result %s,", string(result.Body), test.expectedBody)
}
} else {
if string(result.body) != test.expectedBody {
t.Errorf("got %s, expected result %s,", string(result.body), test.expectedBody)
if string(result.Body) != test.expectedBody {
t.Errorf("got %s, expected result %s,", string(result.Body), test.expectedBody)
}
}
})