testutils

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareWithGolden

func CompareWithGolden(result string, golden []byte) (string, bool)

CompareWithGolden check if a file is the same as golden file. If it is not it produces a pretty diff.

func Diff

func Diff(a, b string) string

Diff produces a pretty diff of two files

func UpdateGoldenFile

func UpdateGoldenFile(path string, content []byte, mode os.FileMode) (changed bool, err error)

UpdateGoldenFile updates a golden file with new contents if the new contents are actually different from what is already there. It returns whether or not the overwrite was performed (i.e. the desired content was different than actual).

Types

This section is empty.

Jump to

Keyboard shortcuts

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