Documentation ¶
Overview ¶
Package tdtest provides support for table-driven testing.
Features include automatically updating of test values, automatic error message generation, and singling out single tests to run.
Auto updating fields is only supported for fields that are scalar types: string, bool, int*, and uint*. If the field is a string, the "actual" value may be any Go value that can meaningfully be printed with fmt.Sprint.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var UpdateTests = false
UpdateTests defines whether tests should be updated by default. This can be overridden on an individual basis using T.Update.
Functions ¶
Types ¶
type T ¶
T is a single test case representing an element in a table. It embeds *testing.T, so all functions of testing.T are available.
func (*T) Equal ¶
Equal compares two fields.
For auto updating to work, field must reference a field in the test case directly.