Documentation
¶
Index ¶
- func AgainstGolden[T any](t TestingT, regenerate bool, got T, goldenPath string, helpers ...GoldenHelper)
- func EqualDiffWithOptionsf[T any](t TestingT, want T, got T, opts cmp.Options, format string, a ...any)
- func Mustf(t TestingT, err error, format string, a ...any)
- func Regenerate() bool
- func UnmarshalFile(path string, o any) (outErr error)
- type GoldenHelper
- type GoldenHelperForAny
- type SortMapStringKeys
- type TestingT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AgainstGolden ¶
func AgainstGolden[T any]( t TestingT, regenerate bool, got T, goldenPath string, helpers ...GoldenHelper, )
AgainstGolden compares a result against the contents of the file at the goldenPath. Run with regenerate set to true to create or update the file.
func EqualDiffWithOptionsf ¶
func EqualDiffWithOptionsf[T any]( t TestingT, want T, got T, opts cmp.Options, format string, a ...any, )
EqualDiffWithOptionsf runs a cmp.Diff with protobuf-specific options.
func Regenerate ¶
func Regenerate() bool
func UnmarshalFile ¶
UnmarshalFile is a utility function for reading and unmarshalling a file containing JSON. The parsing will be strict and disallow unknown fields.
Types ¶
type GoldenHelper ¶
type GoldenHelperForAny ¶
type SortMapStringKeys ¶
type SortMapStringKeys struct{}
func (SortMapStringKeys) CmpOpts ¶
func (fi SortMapStringKeys) CmpOpts() cmp.Options
CmpOpts implements GoldenHelper.
func (SortMapStringKeys) JSONTransform ¶
func (fi SortMapStringKeys) JSONTransform(_ map[string]any) error
JSONTransform implements GoldenHelper.
Click to show internal directories.
Click to hide internal directories.