Documentation ¶
Overview ¶
Package test provides some simple assertion functions to simplify unit tests.
Index ¶
- func Assert(t testingTB, cond bool, val ...interface{})
- func Assertf(t testingTB, cond bool, format string, val ...interface{})
- func DeepEqual(t testingTB, a, b interface{})
- func DeepPrint(out io.Writer, x interface{})
- func Panic(t testingTB, fn func())
- func ThriftRandomFill(obj interface{}, isUnion map[reflect.Type]bool) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Assert ¶
func Assert(t testingTB, cond bool, val ...interface{})
Assert asserts that the given boolean value is true. If cond is false, the optional values will be passed to the testing.TB.Fatal function.
func Assertf ¶
Assertf asserts that the given boolean value is true. If cond is false, the format and the optional values will be passed to the testing.TB.Fatal function.
func DeepEqual ¶
func DeepEqual(t testingTB, a, b interface{})
DeepEqual asserts that `reflect.DeepEqual(a, b)` will return true.
func DeepPrint ¶ added in v0.2.0
DeepPrint prints the given object with its fields recursively. Note that when a pointer is encountered more than once during printing, its subsequent occurrences after the first time will not be print in detail.
Types ¶
This section is empty.