Documentation
¶
Overview ¶
Package testhelp contains test helpers.
Index ¶
- func ExpectErrorIs(t *testing.T, got, want error, context string) bool
- func TestFilesOfExt(t *testing.T, dir, ext string, f func(t *testing.T, name, path string))
- func TestJSONRoundTrip(t *testing.T, want interface{}, context string)
- func TestTomlRoundTrip(t *testing.T, want interface{}, context string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExpectErrorIs ¶
ExpectErrorIs checks whether got has an 'Is' relation to want (or, if want is nil, whether got is non-nil). If not, it fails the test with a message mentioning context and returns false.
func TestFilesOfExt ¶
TestFilesOfExt is a scaffold for running a testing payload on every file in a directory dir that has extension ext. The tester function f receives the extensionless basename name and full path path. ext must contain a leading ".".
func TestJSONRoundTrip ¶
TestJSONRoundTrip tests that encoding want to TOML then decoding it produces a value that is deep-equal to want.
func TestTomlRoundTrip ¶
TestTomlRoundTrip tests that encoding want to TOML then decoding it produces a value that is deep-equal to want.
Types ¶
This section is empty.