Documentation
¶
Overview ¶
Package assert provides a set of assertion functions.
Index ¶
- Constants
- func Equal(t testing.TB, expected, actual interface{}, msgAndArgs ...interface{}) bool
- func Fail(t testing.TB, failureMessage string, ...) bool
- func False(t *testing.T, value bool, msgAndArgs ...interface{}) bool
- func Implements(t *testing.T, interfaceObject interface{}, object interface{}, ...) bool
- func Nil(t *testing.T, object interface{}, msgAndArgs ...interface{}) bool
- func NotEqual(t testing.TB, expected, actual interface{}, msgAndArgs ...interface{}) bool
- func NotNil(t *testing.T, object interface{}, msgAndArgs ...interface{}) bool
- func ParseMsgAndArgs(args ...interface{}) (msgAndArgs []interface{}, format uint)
- func StackTrace(skip int) []string
- func True(t *testing.T, value bool, msgAndArgs ...interface{}) bool
Constants ¶
View Source
const ( // Print a Go-syntax representation of the value. GoSyntax uint = 1 << iota // Pretty-printing of the value. Pretty )
Formatting can be controlled with these flags.
Variables ¶
This section is empty.
Functions ¶
func Equal ¶
Equal asserts that two objects are equal.
assert.Equal(t, 123, 123)
Function equality cannot be determined and will always fail.
func Fail ¶
func Fail( t testing.TB, failureMessage string, callback func(formatter *tablewriter.Table), msgAndArgs ...interface{}, ) bool
Fail reports a failure
func Implements ¶
func Implements(t *testing.T, interfaceObject interface{}, object interface{}, msgAndArgs ...interface{}) bool
Implements asserts that an object is implemented by the specified interface.
assert.Implements(t, (*MyInterface)(nil), new(MyObject))
func NotEqual ¶
NotEqual asserts that the specified values are NOT equal.
assert.NotEqual(t, obj1, obj2)
Function equality cannot be determined and will always fail.
func ParseMsgAndArgs ¶
func ParseMsgAndArgs(args ...interface{}) (msgAndArgs []interface{}, format uint)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.