testutil

package module
v0.0.0-...-da51959 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareFileWithFixture

func CompareFileWithFixture(t *testing.T, outputFile string, opts ...option)

CompareFileWithFixture loads data from the outputFile and compares the content with a golden fixture.

func CompareWithFixture

func CompareWithFixture(t *testing.T, output interface{}, opts ...option) string

CompareWithFixture will compare output with a test fixture and allows to automatically update them by setting the UPDATE env var (configurable via WithUpdateEnv, defaulting to "UPDATE"). If output is not a []byte or string, it will get serialized as yaml prior to the comparison. The fixtures are stored in $PWD/testdata/prefix${testName}.yaml

func WithExtension

func WithExtension(extension string) option

func WithSubDir

func WithSubDir(subDir string) option

func WithSuffix

func WithSuffix(suffix string) option

func WithUpdateEnv

func WithUpdateEnv(env string) option

Types

This section is empty.

Jump to

Keyboard shortcuts

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