Skip to content

Commit

Permalink
fix: 修正 When 在条件不成立时抛出错误的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
caixw committed Sep 8, 2024
1 parent 005ede1 commit 8d67346
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions assertion.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,6 @@ func (a *Assertion) NotMatch(reg *regexp.Regexp, v interface{}, msg ...interface
func (a *Assertion) When(expr bool, f func(a *Assertion), msg ...interface{}) *Assertion {
if expr {
f(a)
} else {
a.TB().Helper()
a.Assert(false, NewFailure("When", msg, nil))
}
return a
}
Expand Down

0 comments on commit 8d67346

Please sign in to comment.