test

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert(expected interface{}, result interface{}, test *testing.T)

Takes in an expected & result object, of any type. Asserts that their Go syntax representations (%#v) are the same. Prints a message on success if the ENV var DEBUG is set to "true". Fails the test if this is not true.

func AssertContains

func AssertContains[T any](slice []T, item T, test *testing.T)

Takes in an expected slice of objects and an 'item' object, of any type Asserts that the 'item' is contained within the slice. Prints a message on success if the ENV var DEBUG is set to "true". Fails the test if this is not true.

func Fail

func Fail(expected interface{}, result interface{}, test *testing.T)

Fails a test with a formatted message showing the expected vs. result. (These are both printed in %#v form)

func FlattenJSON

func FlattenJSON(json string) string

Flattens a given json string, removing all tabs, spaces and newlines

Types

This section is empty.

Jump to

Keyboard shortcuts

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