assert

package
v1.4.6 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal(t testing.TB, first, second interface{}, msg string, args ...interface{})

Equal compares first and second for equality. The objects must be of the same type. If the objects are not equal, the test will be failed with an error message containing msg and args.

func False

func False(t testing.TB, obj interface{}, msg string, args ...interface{})

False asserts that the obj parameter is a boolean with value false.

func Nil

func Nil(t testing.TB, obj interface{}, msg string, args ...interface{})

Nil asserts that the obj parameter is nil.

func NotEqual

func NotEqual(t testing.TB, first, second interface{}, msg string, args ...interface{})

NotEqual compares first and second for inequality. The objects must be of the same type.

func NotNil

func NotNil(t testing.TB, obj interface{}, msg string, args ...interface{})

NotNil asserts that the obj parameter is not nil.

func RegisterOpts

func RegisterOpts(t reflect.Type, opts ...cmp.Option)

RegisterOpts registers go-cmp options for a type. These options will be used when comparing two objects for equality.

func Soon added in v1.4.0

func Soon(t testing.TB, callback func(), timeout time.Duration)

Soon runs the provided callback for a maximum of timeoutMS milliseconds. It returns the callback error if the callback returned and ErrCallbackTimedOut if the timeout expired.

func True

func True(t testing.TB, obj interface{}, msg string, args ...interface{})

True asserts that the obj parameter is a boolean with value true.

Types

This section is empty.

Jump to

Keyboard shortcuts

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