aboutsummaryrefslogtreecommitdiff
path: root/headers_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'headers_test.go')
-rw-r--r--headers_test.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/headers_test.go b/headers_test.go
index 6859690..f00b166 100644
--- a/headers_test.go
+++ b/headers_test.go
@@ -65,17 +65,22 @@ func expectString(t *testing.T, actual string, expected string) {
}
}
-func expectError(t *testing.T, actual error, expected *string) {
+func expectError(t *testing.T, actual error, expected *string) (ok bool) {
t.Helper()
if actual == nil {
if expected != nil {
t.Errorf("expected error %q, got no error\n", *expected)
+ return false
}
} else {
if expected == nil {
t.Errorf("expected no error, got %q\n", actual.Error())
+ return false
} else if *expected != actual.Error() {
t.Errorf("expected error %q, got %q instead\n", *expected, actual.Error())
+ return false
}
}
+
+ return true
}