Documentation
¶
Index ¶
- func ErrorIf(a ErrorAssertions, wantErr bool, err error, msgAndArgs ...any) bool
- func NilIf(a NilAssertions, wantNil bool, object any, msgAndArgs ...any) bool
- func PanicsIf(a PanicsAssertions, wantPanic bool, f assert.PanicTestFunc, msgAndArgs ...any) bool
- func ZeroIf(a ZeroAssertions, wantNil bool, i any, msgAndArgs ...any) bool
- type ErrorAssertions
- type NilAssertions
- type PanicsAssertions
- type ZeroAssertions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorIf ¶
func ErrorIf(a ErrorAssertions, wantErr bool, err error, msgAndArgs ...any) bool
ErrorIf asserts that err is not nil if wantErr is true, or nil if wantErr is false.
func NilIf ¶
func NilIf(a NilAssertions, wantNil bool, object any, msgAndArgs ...any) bool
NilIf asserts that the specified object is nil if wantNil is true, or not nil if wantNil is false.
func PanicsIf ¶
func PanicsIf(a PanicsAssertions, wantPanic bool, f assert.PanicTestFunc, msgAndArgs ...any) bool
PanicsIf asserts that function panics if wantPanic is true, or does not panic if wantPanic is false.
Types ¶
type ErrorAssertions ¶
type ErrorAssertions interface {
Error(err error, msgAndArgs ...any) bool
NoError(err error, msgAndArgs ...any) bool
}
ErrorAssertions checks errors.
type NilAssertions ¶
type NilAssertions interface {
Nil(object any, msgAndArgs ...any) bool
NotNil(object any, msgAndArgs ...any) bool
}
NilAssertions checks nilness.
type PanicsAssertions ¶
type PanicsAssertions interface {
Panics(f assert.PanicTestFunc, msgAndArgs ...any) bool
NotPanics(f assert.PanicTestFunc, msgAndArgs ...any) bool
}
PanicsAssertions checks panics.
Click to show internal directories.
Click to hide internal directories.