Documentation
¶
Overview ¶
Package goldentest is a utility to help create tests that compare a result (e.g. serialized data or formatted text) against a golden file stored in testdata.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Check ¶
Check looks for a file at testdata/{t.Name()}/[goldenPath], compares [actual] against the content, and causes the test to fail if it's incorrect.
If [goldenPath] starts with '*' and optionally has some characters after, the content is instead looked for at testdata/{t.Name()}[after]. Use this if dirs aren't useful for organization. After the '*' is typically a file extension, or perhaps extra context clues.
If "-update" or "-args update" is passed to the "go test" command, instead of failing, writes [actual] to the file.
func CheckFullPath ¶ added in v0.0.7
CheckFullPath behaves like Check, but takes a full path to the golden file.
Types ¶
This section is empty.