Documentation
¶
Index ¶
- func IsEmpty(object interface{}) bool
- func IsNil(object interface{}) bool
- type Helper
- type T
- type Tester
- func (t *Tester) Empty(object interface{}, msgAndArgs ...interface{}) bool
- func (t *Tester) Equal(expected, actual any, msgAndArgs ...interface{}) bool
- func (t *Tester) Error(err error, msgAndArgs ...interface{}) bool
- func (t *Tester) Fail(failureMessage string, msgAndArgs ...interface{}) bool
- func (t *Tester) False(value bool, msgAndArgs ...interface{}) bool
- func (t *Tester) Nil(object interface{}, msgAndArgs ...interface{}) bool
- func (t *Tester) NoError(err error, msgAndArgs ...interface{}) bool
- func (t *Tester) NotEmpty(object interface{}, msgAndArgs ...interface{}) bool
- func (t *Tester) NotEqual(expected, actual any, msgAndArgs ...interface{}) bool
- func (t *Tester) NotNil(object interface{}, msgAndArgs ...interface{}) bool
- func (t *Tester) True(value bool, msgAndArgs ...interface{}) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Tester ¶
func (*Tester) Error ¶
Error asserts that a function returned an error (i.e. not `nil`).
actualObj, err := SomeFunction()
if assert.Error(t, err) {
assert.Equal(t, expectedError, err)
}
func (*Tester) NoError ¶
NoError asserts that a function returned no error (i.e. `nil`).
actualObj, err := SomeFunction()
if assert.NoError(t, err) {
assert.Equal(t, expectedObj, actualObj)
}
Click to show internal directories.
Click to hide internal directories.