assert

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: Apache-2.0 Imports: 6 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(ctx context.Context), timeout time.Duration)

Soon runs the provided callback for a maximum of timeoutMS milliseconds. The provided callback should respect the passed-in context and cease execution when it has 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