Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var MustMatch = MustMatchFn(nil, nil)
MustMatch is a convenience version of MustMatchFn with no overrides. Usage in Test*() function:
testutils.MustMatch(t, want, got, "something doesn't match")
Functions ¶
func MustMatchFn ¶
func MustMatchFn(allowUnexportedTypes []interface{}, ignoredFields []string, extraOpts ...cmp.Option) func(t *testing.T, want, got interface{}, errMsg string)
MustMatchFn is used to create a common diff function for a test file Usage in *_test.go file:
Top declaration:
var mustMatch = testutils.MustMatchFn(
[]interface{}{ // types with unexported fields type1{}, type2{}, ... typeN{}, }, []string{ // ignored fields ".id", // id numbers are unstable ".createAt", // created dates might not be interesting to compare },
)
In Test*() function:
mustMatch(t, want, got, "something doesn't match")
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.