gm

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataFileDiffers

func DataFileDiffers(filename string, v interface{}) (bool, error)

DataFileDiffers compares the specified value against the stored data file

func GetFilenameForTest

func GetFilenameForTest(testName string) (string, error)

GetFilenameForTest convers a Go test name to filename

func GitDiff

func GitDiff(path string) (string, error)

GitDiff does 'git diff' on the specified file, first changing to its directory. It returns the diff and error, if any

func Verify

func Verify(t *testing.T, data interface{})

Verify invokes VerifyNamed with empty 'name' argument

func VerifyNamed

func VerifyNamed(t *testing.T, name string, data interface{})

VerifyNamed generates a file name based on current test name and the 'name' argument and compares its content in git index (i.e. staged or committed if now changes are staged for the file) to the JSON serializes of 'data' argument, ignoring any JSON formatting differences. The test will fail if the data differs. In this case the target file is updated and the user must stage or commit the changes to make the test pass.

func WriteDataFile

func WriteDataFile(filename string, v interface{}) error

WriteDataFile serializes the specified value into a data file

Types

This section is empty.

Jump to

Keyboard shortcuts

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