Documentation ¶
Index ¶
- func Assert(condition bool, format string, v ...interface{}) bool
- func Contain(t testing.TB, container, object interface{}, msgAndArgs ...interface{}) bool
- func ElementMatch(t testing.TB, listA, listB interface{}, msgAndArgs ...interface{}) bool
- func Empty(t testing.TB, object interface{}, msgAndArgs ...interface{}) bool
- func Equal(t testing.TB, expected, actual interface{}, msgAndArgs ...interface{}) bool
- func EqualValue(t testing.TB, expected, actual interface{}, msgAndArgs ...interface{}) bool
- func False(t testing.TB, value bool, msgAndArgs ...interface{}) bool
- func Implements(t testing.TB, interfaceObject interface{}, object interface{}, ...) bool
- func InDelta(t testing.TB, expected, actual interface{}, eps float64, ...) bool
- func IsObjectEmpty(object interface{}) bool
- func IsObjectEqual(expected, actual interface{}) bool
- func IsObjectNil(object interface{}) bool
- func IsObjectValueEqual(expected, actual interface{}) bool
- func IsObjectZero(object interface{}) bool
- func IsPointerSame(first, second interface{}) bool
- func IsType(t testing.TB, expected interface{}, object interface{}, ...) bool
- func Nil(t testing.TB, object interface{}, msgAndArgs ...interface{}) bool
- func NotContain(t testing.TB, container, object interface{}, msgAndArgs ...interface{}) bool
- func NotEmpty(t testing.TB, object interface{}, msgAndArgs ...interface{}) bool
- func NotEqual(t testing.TB, expected, actual interface{}, msgAndArgs ...interface{}) bool
- func NotEqualValue(t testing.TB, expected, actual interface{}, msgAndArgs ...interface{}) bool
- func NotInDelta(t testing.TB, expected, actual interface{}, eps float64, ...) bool
- func NotNil(t testing.TB, object interface{}, msgAndArgs ...interface{}) bool
- func NotPanic(t testing.TB, f func(), msgAndArgs ...interface{}) bool
- func NotSamePointer(t testing.TB, expected, actual interface{}, msgAndArgs ...interface{}) bool
- func NotZero(t testing.TB, object interface{}, msgAndArgs ...interface{}) bool
- func Panic(t testing.TB, f func(), msgAndArgs ...interface{}) bool
- func PanicWithValue(t testing.TB, expected interface{}, f func(), msgAndArgs ...interface{}) bool
- func SamePointer(t testing.TB, expected, actual interface{}, msgAndArgs ...interface{}) bool
- func True(t testing.TB, value bool, msgAndArgs ...interface{}) bool
- func Zero(t testing.TB, object interface{}, msgAndArgs ...interface{}) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contain ¶ added in v1.4.2
Contain asserts that the specified container contains the specified substring or element. Support string, array, slice or map.
func ElementMatch ¶ added in v1.4.2
ElementMatch asserts that the specified listA is equal to specified listB ignoring the order of the elements. If there are duplicate elements, the number of appearances of each of them in both lists should match.
func EqualValue ¶ added in v1.4.2
EqualValue asserts that two objects are equal or convertible to the same types and equal.
func Implements ¶ added in v1.4.2
func Implements(t testing.TB, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool
Implements asserts that an object is implemented by the specified interface.
func InDelta ¶ added in v1.4.2
func InDelta(t testing.TB, expected, actual interface{}, eps float64, msgAndArgs ...interface{}) bool
InDelta asserts that the two numerals are within delta of each other.
func IsObjectEmpty ¶ added in v1.4.2
func IsObjectEmpty(object interface{}) bool
IsObjectEmpty gets whether the specified object is considered empty or not. Example:
- Array, Chan, Map, Slice -> Len = 0
- Ptr -> ptr == nil || ptr == nil
- Other -> zero value
func IsObjectEqual ¶ added in v1.4.2
func IsObjectEqual(expected, actual interface{}) bool
IsObjectEqual determines if two objects are considered equal.
func IsObjectNil ¶ added in v1.4.2
func IsObjectNil(object interface{}) bool
IsObjectNil checks if a specified object is nil or not.
func IsObjectValueEqual ¶ added in v1.4.2
func IsObjectValueEqual(expected, actual interface{}) bool
IsObjectValueEqual gets whether two objects are equal, or if their values are equal.
func IsObjectZero ¶ added in v1.4.2
func IsObjectZero(object interface{}) bool
IsObjectZero gets whether the specified object is the zero value of its type.
func IsPointerSame ¶ added in v1.4.2
func IsPointerSame(first, second interface{}) bool
IsPointerSame compares two generic interface objects and returns whether they point to the same object.
func NotContain ¶ added in v1.4.2
NotContain asserts that the specified container does not contain the specified substring or element. Support string, array, slice or map.
func NotEqualValue ¶ added in v1.4.2
NotEqualValue asserts that two objects are not equal even when converted to the same type.
func NotInDelta ¶ added in v1.4.2
func NotInDelta(t testing.TB, expected, actual interface{}, eps float64, msgAndArgs ...interface{}) bool
NotInDelta asserts that the two numerals are not within delta of each other.
func NotPanic ¶ added in v1.4.2
NotPanic asserts that the code inside the specified function does not panic.
func NotSamePointer ¶ added in v1.4.2
NotSamePointer asserts that two pointers do not reference the same object.
func NotZero ¶ added in v1.4.2
NotEmpty asserts that the specified object is not the zero value for its type.
func PanicWithValue ¶ added in v1.4.2
PanicWithValue asserts that the code inside the specified function panics, and the recovered value equals the expected value.
func SamePointer ¶ added in v1.4.2
SamePointer asserts that two pointers reference the same object.
Types ¶
This section is empty.