Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EqualComparable ¶
func EqualComparable[T comparable](a, b T) bool
EqualComparable reports whether a and b are equal. Use for comparable types only; no reflection, inlineable.
func EqualValues ¶ added in v0.0.9
EqualValues reports whether a and b are equal. For use as a test helper (accepts testing.TB). For error values, uses errors.Is for wrapped error comparison; otherwise uses reflect.DeepEqual. Moved from matchers package; assert is the single source of truth for equality helpers.
func IsNilValue ¶
IsNilValue reports whether value is nil or a nil pointer/slice/map/etc.
func MatchWithFastPath ¶ added in v0.0.9
MatchWithFastPath runs the matcher with direct type dispatch for built-in matchers to avoid interface calls. Returns (matched, failureMsg). Custom matchers fall back to matcher.Match / matcher.FailureMessage.
func ValuesEqual ¶
ValuesEqual reports whether expected and actual are equal (for use by other packages).
Types ¶
type Matcher ¶
Matcher is the interface for assertion matchers used with Expect(...).To(m).
func BeFalse ¶
func BeFalse() Matcher
BeFalse returns a matcher that expects actual to be the bool false. Returns singleton; zero alloc.
func BeNil ¶
func BeNil() Matcher
BeNil returns a matcher that expects actual to be nil. Returns singleton; zero alloc.
func BeTrue ¶
func BeTrue() Matcher
BeTrue returns a matcher that expects actual to be the bool true. Returns singleton; zero alloc.
func Contain ¶
Contain returns a matcher that expects actual (string or slice) to contain expected. Struct-based; no closure.