Skip to content

Commit 973d38f

Browse files
committed
fix: fix NotPanicNow does not stop execution error.
1 parent 7bb623b commit 973d38f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

builtin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,5 @@ func NotPanic(t *testing.T, fn func(), message ...string) error {
105105
func NotPanicNow(t *testing.T, fn func(), message ...string) error {
106106
t.Helper()
107107

108-
return tryNotPanic(t, false, fn, message...)
108+
return tryNotPanic(t, true, fn, message...)
109109
}

panic.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (a *Assertion) NotPanic(fn func(), message ...string) error {
3434
func (a *Assertion) NotPanicNow(fn func(), message ...string) error {
3535
a.Helper()
3636

37-
return tryNotPanic(a.T, false, fn, message...)
37+
return tryNotPanic(a.T, true, fn, message...)
3838
}
3939

4040
// tryPanic executes the function fn, and try to catching the panic error. It expect the function

0 commit comments

Comments
 (0)