Documentation
¶
Index ¶
- func AssertValidJSON(tb testing.TB, s string)
- func AssertValidJSONBytes(tb testing.TB, b []byte)
- func DiffBytes(tb testing.TB, got, want []byte, gotlabel, wantLabel string)
- func DiffBytesWithGolden(tb testing.TB, buf []byte, goldenFile string)
- func ValidJSON(s string) error
- func ValidJSONBytes(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertValidJSON ¶
AssertValidJSON checks the given string is valid JSON.
func AssertValidJSONBytes ¶
AssertValidJSONBytes checks the given buffer is valid JSON.
func DiffBytes ¶
DiffBytes is a test helper that compares 2 bytes slices. If they differ, the test is failed and DiffBytes shows an hexadecimal diff (à la hexdump).
labels[0] and labels[1] can be used to personalize the title diff, instead of 'got' and 'want', respectively.
func DiffBytesWithGolden ¶
DiffBytesWithGolden is a test helper that compares some bytes with a file content whose path is provided in the 'goldenFile' argument. If -update flag is given to go test, the golden file is updated with the new content, provided by 'buf'.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.