testutils

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2018 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package testutils provides utilities used in tests

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertDeepEqual

func AssertDeepEqual(t *testing.T, a interface{}, b interface{}, message string)

AssertDeepEqual fails a test if the actual does not deeply equal the expected

func AssertEqual

func AssertEqual(t *testing.T, a interface{}, b interface{}, message string)

AssertEqual errors a test if the actual does not match the expected

func AssertEqualf

func AssertEqualf(t *testing.T, a interface{}, b interface{}, message string)

AssertEqualf fails a test if the actual does not match the expected

func AssertNotEqual

func AssertNotEqual(t *testing.T, a interface{}, b interface{}, message string)

AssertNotEqual fails a test if the actual matches the expected

func IsEqualJSON

func IsEqualJSON(s1, s2 []byte) (bool, error)

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

func MustMarshalJSON(t *testing.T, v interface{}) []byte

MustMarshalJSON marshalls the given interface into JSON. If there is any error, it fails the test.

func MustUnmarshalJSON

func MustUnmarshalJSON(t *testing.T, data []byte, v interface{})

MustUnmarshalJSON marshalls the given interface into JSON. If there is any error, it fails the test.

func ReadJSON

func ReadJSON(path string, destination interface{})

ReadJSON reads JSON fixture to the struct at the destination address

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL