Documentation
¶
Index ¶
- func Contains(t *testing.T, list interface{}, element interface{})
- func Empty(t *testing.T, object interface{})
- func Equal(t *testing.T, actual, expected interface{})
- func EqualVal(t *testing.T, actual, expected interface{})
- func Error(t *testing.T, err interface{})
- func False(t *testing.T, value bool)
- func HasNotPrefix(t *testing.T, str string, prefix string)
- func HasNotSuffix(t *testing.T, str string, prefix string)
- func HasPrefix(t *testing.T, str string, prefix string)
- func HasSuffix(t *testing.T, str string, prefix string)
- func Implements(t *testing.T, object interface{}, interfaceObject interface{})
- func Len(t *testing.T, object interface{}, length int)
- func Nil(t *testing.T, object interface{})
- func NoError(t *testing.T, err interface{})
- func NoPanic(t *testing.T, action func())
- func NotContains(t *testing.T, list interface{}, element interface{})
- func NotEmpty(t *testing.T, object interface{})
- func NotEqual(t *testing.T, actual, expected interface{})
- func NotEqualVal(t *testing.T, actual, expected interface{})
- func NotNil(t *testing.T, object interface{})
- func NotZero(t *testing.T, object interface{})
- func Panic(t *testing.T, action func())
- func SameType(t *testing.T, object interface{}, anotherObject interface{})
- func True(t *testing.T, value bool)
- func Zero(t *testing.T, object interface{})
- type Assert
- func (a *Assert) Contains(list interface{}, element interface{})
- func (a *Assert) Empty(object interface{})
- func (a *Assert) Equal(actual, expected interface{})
- func (a *Assert) EqualVal(actual, expected interface{})
- func (a *Assert) Error(error interface{})
- func (a *Assert) False(value bool)
- func (a *Assert) HasNotPrefix(str, prefix string)
- func (a *Assert) HasNotSuffix(str, suffix string)
- func (a *Assert) HasPrefix(str, prefix string)
- func (a *Assert) HasSuffix(str, suffix string)
- func (a *Assert) Implements(object interface{}, interfaceObject interface{})
- func (a *Assert) Len(object interface{}, length int)
- func (a *Assert) Nil(object interface{})
- func (a *Assert) NoError(error interface{})
- func (a *Assert) NoPanic(action func())
- func (a *Assert) NotContains(list interface{}, element interface{})
- func (a *Assert) NotEmpty(object interface{})
- func (a *Assert) NotEqual(actual, expected interface{})
- func (a *Assert) NotEqualVal(actual, expected interface{})
- func (a *Assert) NotNil(object interface{})
- func (a *Assert) NotZero(object interface{})
- func (a *Assert) Panic(action func())
- func (a *Assert) SameType(object interface{}, anotherObject interface{})
- func (a *Assert) True(value bool)
- func (a *Assert) Zero(object interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Empty ¶
Empty asserts that the specified object is empty. I.e. nil, "", false, 0 or either a slice or a channel with len == 0.
assert.Empty(t, obj)
func EqualVal ¶
EqualVal asserts that two objects are equal (convertable to the same types and equal).
assert.EqualVal(t, uint32(123), int32(123))
func Implements ¶
Implements asserts that an object is implemented by the specified interface.
assert.Implements(t, new(MyObject), (*MyInterface)(nil))
func NotContains ¶
Support array, slice, map, chan, string
func NotEqual ¶
NotEqual asserts that the specified values are NOT equal.
assert.NotEqual(t, obj1, obj2)
func NotEqualVal ¶
NotEqualVal asserts that two objects are NOT equal(convertable to the same types and equal).
assert.NotEqualVal(t, uint32(123), int32(123))
func NotZero ¶
NotZero asserts that object is not the zero value for its type and returns the truth.
func SameType ¶
SameType asserts that the specified objects are of the same type.
assert.SameType(t, "1", "1")
Types ¶
type Assert ¶
type Assert struct {
// contains filtered or unexported fields
}
func (*Assert) HasNotPrefix ¶
func (*Assert) HasNotSuffix ¶
func (*Assert) Implements ¶
func (a *Assert) Implements(object interface{}, interfaceObject interface{})
func (*Assert) NotContains ¶
func (a *Assert) NotContains(list interface{}, element interface{})
func (*Assert) NotEqualVal ¶
func (a *Assert) NotEqualVal(actual, expected interface{})
Click to show internal directories.
Click to hide internal directories.