test

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 19 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 added in v0.3.0

func CompareErrorMessages() cmp.Option

CompareErrorMessages compares errors by message.

func CompareLoggers added in v0.3.0

func CompareLoggers() cmp.Option

CompareLoggers compares instances of log.Logger.

func ComparePGPKeys added in v0.3.0

func ComparePGPKeys() cmp.Option

ComparePGPKeys compares PGP keys' fingerprints.

func CompareRSAPrivateKeys added in v0.4.0

func CompareRSAPrivateKeys() cmp.Option

CompareRSAPrivateKeys compares RSA private keys.

func ExportAll added in v0.3.0

func ExportAll() cmp.Option

ExportAll exports all unexported fields.

func Golden added in v0.4.0

func Golden(t *testing.T, golden, result string)

Golden compares the result directory to the golden directory and updates the golden directory if the UPDATE_GOLDEN environment variable is set.

func IgnoreFunctions added in v0.3.0

func IgnoreFunctions() cmp.Option

IgnoreFunctions ignores all functions.

func Source

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

func SourceWant added in v0.3.0

func SourceWant() []*source.Release

func Target

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

Types

type TargetOption added in v0.3.0

type TargetOption func(*targetOptions)

func WithDelay added in v0.3.0

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 added in v0.3.0

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