Documentation
¶
Index ¶
- func Build[C any](t *testing.T, build func(context.Context, *C) error, config *C, dir string)
- func CompareErrorMessages() cmp.Option
- func CompareFS() cmp.Option
- func CompareFSStrict() cmp.Option
- func CompareLoggers() cmp.Option
- func ComparePGPKeys() cmp.Option
- func CompareRSAPrivateKeys() cmp.Option
- func ExportAll() cmp.Option
- func Golden(t *testing.T, golden, result string, filter ...PathFilter)
- func GoldenFile(t *testing.T, file string, data []byte)
- func IgnoreFSMeta() cmp.Option
- func IgnoreFunctions() cmp.Option
- func IgnoreKeys(patterns ...string) cmp.Option
- func JoinYAML(s ...string) []byte
- func ReadFS(fsys fs.FS) fstest.MapFS
- func Source(t *testing.T, s *source.Source, makeURL func(version, asset string) string)
- func SourceWant() []*source.Release
- func Target(t *testing.T, tgt target.Target, makeURL func(string) string, ...)
- func YAML(s string) []byte
- type PathFilter
- type TargetOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareErrorMessages ¶
CompareErrorMessages compares errors by message.
func CompareFS ¶ added in v0.7.0
CompareFS compares file systems by transforming them into fstest.MapFS. It ignores the modification time and underlying data source.
func CompareFSStrict ¶ added in v0.7.0
CompareFSStrict compares file systems by transforming them into fstest.MapFS.
func CompareLoggers ¶
CompareLoggers compares instances of log.Logger.
func ComparePGPKeys ¶
ComparePGPKeys compares PGP keys' fingerprints.
func CompareRSAPrivateKeys ¶
CompareRSAPrivateKeys compares RSA private keys.
func Golden ¶
func Golden(t *testing.T, golden, result string, filter ...PathFilter)
Golden compares the result directory to the golden directory and updates the golden directory if the UPDATE_GOLDEN environment variable is set.
func IgnoreFSMeta ¶ added in v0.7.0
IgnoreFSMeta ignores the metadata of a file in a fstest.MapFS.
func IgnoreKeys ¶ added in v0.7.0
IgnoreKeys ignores keys in a map that match the given patterns.
func ReadFS ¶ added in v0.7.0
ReadFS reads the contents of a file system and returns a map of file paths to their contents.
func SourceWant ¶
Types ¶
type PathFilter ¶
func Ignore ¶
func Ignore(globs ...string) PathFilter
Ignore returns a PathFilter that ignores files matching the given globs.
type TargetOption ¶
type TargetOption func(*targetOptions)
func WithDelay ¶
func WithDelay(d time.Duration) TargetOption
WithDelay adds a delay between writing, updating & reading, to allow for services where the changes aren't available instantly.
func WithIgnoreRemoveNotFound ¶
func WithIgnoreRemoveNotFound() TargetOption
WithIgnoreRemoveNotFound disables testing if removing a non-existent file returns an error.