Skip to content

Commit

Permalink
docs: fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
caixw committed Feb 27, 2024
1 parent 86a6660 commit f5ffce7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions assertion.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ func (a *Assertion) PanicType(fn func(), typ interface{}, msg ...interface{}) *A
return a.Assert(false, NewFailure("PanicType", msg, nil))
}

// NotPanic 断言 fn 不会 panic
func (a *Assertion) NotPanic(fn func(), msg ...interface{}) *Assertion {
a.TB().Helper()

has, m := hasPanic(fn)
return a.Assert(!has, NewFailure("NotPanic", msg, map[string]interface{}{"err": m}))
}
Expand Down Expand Up @@ -307,7 +307,7 @@ func (a *Assertion) TypeEqual(ptr bool, v1, v2 interface{}, msg ...interface{})
a.TB().Helper()

t1, t2 := getType(ptr, v1, v2)
return a.Assert(t1 == t2, NewFailure("TypeEquaal", msg, map[string]interface{}{"v1": t1, "v2": t2}))
return a.Assert(t1 == t2, NewFailure("TypeEqual", msg, map[string]interface{}{"v1": t1, "v2": t2}))
}

// Same 断言为同一个对象
Expand Down Expand Up @@ -358,8 +358,6 @@ func (a *Assertion) Match(reg *regexp.Regexp, v interface{}, msg ...interface{})
}

// NotMatch 断言 v 是否不匹配正则表达式 reg
//
// reg 可以是 [regexp.Regexp] 或是正则表达式的字符串。
func (a *Assertion) NotMatch(reg *regexp.Regexp, v interface{}, msg ...interface{}) *Assertion {
a.TB().Helper()
switch val := v.(type) {
Expand Down

0 comments on commit f5ffce7

Please sign in to comment.