Documentation ¶
Index ¶
- func DataFileDiffers(filename string, v interface{}) (bool, error)
- func GetFilenameForTest(testName string) (string, error)
- func GitDiff(path string) (string, error)
- func Verify(t *testing.T, data interface{})
- func VerifyNamed(t *testing.T, name string, data interface{})
- func WriteDataFile(filename string, v interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DataFileDiffers ¶
DataFileDiffers compares the specified value against the stored data file
func GetFilenameForTest ¶
GetFilenameForTest convers a Go test name to filename
func GitDiff ¶
GitDiff does 'git diff' on the specified file, first changing to its directory. It returns the diff and error, if any
func VerifyNamed ¶
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 ¶
WriteDataFile serializes the specified value into a data file
Types ¶
This section is empty.