Documentation ¶
Overview ¶
Package assert provides helper functions that can be used with the standard Go testing package.
Index ¶
- func Equal(t TestingT, got, expected interface{}, msgAndArgs ...interface{}) bool
- func NoError(t TestingT, err error, msgAndArgs ...interface{}) bool
- func NotEqual(t TestingT, got, expected interface{}, msgAndArgs ...interface{}) bool
- func PanicsWithValue(t TestingT, expected interface{}, fn PanicTestFunc, msgAndArgs ...interface{}) bool
- func ValuesAreEqual(got, expected interface{}) bool
- func ValuesAreExactlyEqual(got, expected interface{}) bool
- type PanicTestFunc
- type TestingT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Equal ¶
Equal asserts that the values are equal and returns true if the assertion was successful.
func NotEqual ¶
NotEqual asserts that the values are not equal and returns true if the assertion was successful.
func PanicsWithValue ¶
func PanicsWithValue(t TestingT, expected interface{}, fn PanicTestFunc, msgAndArgs ...interface{}) bool
PanicsWithValue asserts that fn panics, and that the recovered panic value equals the expected panic value.
Returns true if the assertion was successful.
func ValuesAreEqual ¶
func ValuesAreEqual(got, expected interface{}) bool
ValuesAreEqual determines if the values are equal.
func ValuesAreExactlyEqual ¶
func ValuesAreExactlyEqual(got, expected interface{}) bool
ValuesAreExactlyEqual determines if the values are equal and their types are the same.
Types ¶
type PanicTestFunc ¶
type PanicTestFunc func()
PanicTestFunc defines a function that is called to determine whether a panic occurs.