test

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Update, _ = strconv.ParseBool(os.Getenv("UPDATE_GOLDEN")) //nolint:gochecknoglobals

Update indicates whether golden files should be updated.

Functions

func CompareErrorMessages

func CompareErrorMessages() cmp.Option

CompareErrorMessages compares errors by message.

func CompareLoggers

func CompareLoggers() cmp.Option

CompareLoggers compares instances of log.Logger.

func ComparePGPKeys

func ComparePGPKeys() cmp.Option

ComparePGPKeys compares PGP keys' fingerprints.

func CompareRSAPrivateKeys

func CompareRSAPrivateKeys() cmp.Option

CompareRSAPrivateKeys compares RSA private keys.

func ExportAll

func ExportAll() cmp.Option

ExportAll exports all unexported fields.

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 IgnoreFunctions

func IgnoreFunctions() cmp.Option

IgnoreFunctions ignores all functions.

func JoinYAML

func JoinYAML(s ...string) []byte

func Source

func Source(t *testing.T, s *source.Source, makeURL func(version, asset string) string)

func SourceWant

func SourceWant() []*source.Release

func Target

func Target(t *testing.T, tgt target.Target, makeURL func(string) string, opt ...TargetOption)

func YAML

func YAML(s string) []byte

Types

type PathFilter

type PathFilter func(path string) bool

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL