Skip to content

Commit 26d6fa0

Browse files
More concrete error in Panics and PanicsWithValue
1 parent 1c264b1 commit 26d6fa0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

assert/assertions.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ func Panics(t TestingT, f PanicTestFunc, msgAndArgs ...interface{}) bool {
876876
}
877877

878878
if funcDidPanic, panicValue := didPanic(f); !funcDidPanic {
879-
return Fail(t, fmt.Sprintf("func %#v should panic\n\tPanic value:\t%v", f, panicValue), msgAndArgs...)
879+
return Fail(t, fmt.Sprintf("func %#v should panic\n\tPanic value:\t%#v", f, panicValue), msgAndArgs...)
880880
}
881881

882882
return true
@@ -893,10 +893,10 @@ func PanicsWithValue(t TestingT, expected interface{}, f PanicTestFunc, msgAndAr
893893

894894
funcDidPanic, panicValue := didPanic(f)
895895
if !funcDidPanic {
896-
return Fail(t, fmt.Sprintf("func %#v should panic\n\tPanic value:\t%v", f, panicValue), msgAndArgs...)
896+
return Fail(t, fmt.Sprintf("func %#v should panic\n\tPanic value:\t%#v", f, panicValue), msgAndArgs...)
897897
}
898898
if panicValue != expected {
899-
return Fail(t, fmt.Sprintf("func %#v should panic with value:\t%v\n\tPanic value:\t%v", f, expected, panicValue), msgAndArgs...)
899+
return Fail(t, fmt.Sprintf("func %#v should panic with value:\t%#v\n\tPanic value:\t%#v", f, expected, panicValue), msgAndArgs...)
900900
}
901901

902902
return true

0 commit comments

Comments
 (0)