util

package
v0.0.0-...-8cbfcf2 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 8 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare(content, golden []byte) error

Compare compares two byte slices. It returns an error with a contextual diff if they are not equal.

func CompareBytes

func CompareBytes(t test.Failer, content []byte, golden []byte, name string)

CompareBytes compares the content value against the golden bytes and fails the test if they differ

func CompareContent

func CompareContent(t test.Failer, content []byte, goldenFile string)

CompareContent compares the content value against the golden file and fails the test if they differ

func ReadFile

func ReadFile(t test.Failer, file string) []byte

ReadFile reads the content of the given file or fails the test if an error is encountered.

func ReadGoldenFile

func ReadGoldenFile(t test.Failer, content []byte, goldenFile string) []byte

ReadGoldenFile reads the content of the golden file and fails the test if an error is encountered

func Refresh

func Refresh() bool

Refresh controls whether to update the golden artifacts instead. It is set using the environment variable REFRESH_GOLDEN.

func RefreshGoldenFile

func RefreshGoldenFile(t test.Failer, content []byte, goldenFile string)

RefreshGoldenFile updates the golden file with the given content

func StripVersion

func StripVersion(yaml []byte) []byte

StripVersion strips the version fields of a YAML content.

Types

This section is empty.

Jump to

Keyboard shortcuts

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