istio: istio.io/istio/pilot/test/util Index | Files

package util

import "istio.io/istio/pilot/test/util"

Index

Package Files

diff.go

func Compare Uses

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 Uses

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 Uses

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 Uses

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

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

func ReadFile Uses

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 Uses

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 Uses

func Refresh() bool

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

func RefreshGoldenFile Uses

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

RefreshGoldenFile updates the golden file with the given content

func StripVersion Uses

func StripVersion(yaml []byte) []byte

StripVersion strips the version fields of a YAML content.

Package util imports 7 packages (graph) and is imported by 2 packages. Updated 2020-06-02. Refresh now. Tools for package owners.