Documentation
¶
Overview ¶
Package testutils provides utilities used in tests
Index ¶
- func AssertDeepEqual(t *testing.T, a interface{}, b interface{}, message string)
- func AssertEqual(t *testing.T, a interface{}, b interface{}, message string)
- func AssertEqualf(t *testing.T, a interface{}, b interface{}, message string)
- func AssertNotEqual(t *testing.T, a interface{}, b interface{}, message string)
- func IsEqualJSON(s1, s2 []byte) (bool, error)
- func MustExec(t *testing.T, message string, db *sql.DB, query string, args ...interface{}) sql.Result
- func MustMarshalJSON(t *testing.T, v interface{}) []byte
- func MustUnmarshalJSON(t *testing.T, data []byte, v interface{})
- func ReadJSON(path string, destination interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertDeepEqual ¶
AssertDeepEqual fails a test if the actual does not deeply equal the expected
func AssertEqual ¶
AssertEqual errors a test if the actual does not match the expected
func AssertEqualf ¶
AssertEqualf fails a test if the actual does not match the expected
func AssertNotEqual ¶
AssertNotEqual fails a test if the actual matches the expected
func IsEqualJSON ¶
IsEqualJSON deeply compares two JSON byte slices
func MustExec ¶
func MustExec(t *testing.T, message string, db *sql.DB, query string, args ...interface{}) sql.Result
MustExec executes the given SQL query and fails a test if an error occurs
func MustMarshalJSON ¶
MustMarshalJSON marshalls the given interface into JSON. If there is any error, it fails the test.
func MustUnmarshalJSON ¶
MustUnmarshalJSON marshalls the given interface into JSON. If there is any error, it fails the test.
Types ¶
This section is empty.