Back to godoc.org
istio.io/istio/pilot/test/util

package util

v0.0.0 (e2580f5)
Latest Go to latest
Published: 5 hours ago | License: Apache-2.0 | Module: istio.io/istio

Index

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(content []byte, golden []byte, name string, t *testing.T)

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

func CompareContent

func CompareContent(content []byte, goldenFile string, t *testing.T)

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

func CompareYAML

func CompareYAML(filename string, t *testing.T)

CompareYAML compares a file "x" against a golden file "x.golden"

func ReadFile

func ReadFile(file string, t testing.TB) []byte

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

func ReadGoldenFile

func ReadGoldenFile(content []byte, goldenFile string, t *testing.T) []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(content []byte, goldenFile string, t *testing.T)

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.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier