Documentation ¶
Overview ¶
Package golden provides tools for comparing large mutli-line strings.
Golden files are files in the ./testdata/ subdirectory of the package under test.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Assert ¶
Assert compares the actual content to the expected content in the golden file. If the `-test.update-golden` flag is set then the actual content is written to the golden file. Returns whether the assertion was successful (true) or not (false)
Example ¶
Assert(t, "foo", "foo-content.golden")
Output:
func AssertBytes ¶
func AssertBytes(t require.TestingT, actual []byte, filename string, msgAndArgs ...interface{}) bool
AssertBytes compares the actual result to the expected result in the golden file. If the `-test.update-golden` flag is set then the actual content is written to the golden file. Returns whether the assertion was successful (true) or not (false) nolint: lll
Example ¶
AssertBytes(t, []byte("foo"), "foo-content.golden")
Output:
Types ¶
This section is empty.