test

package
v0.0.0-...-406b1e7 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertEvents

func AssertEvents(t *testing.T, actualCh any, expected ...any) bool

AssertEvents asserts that the expected list of events was received on the actual channel and no unexpected events are enqueued there

func AssertForefrontEvents

func AssertForefrontEvents(t *testing.T, actualCh any, expected ...any) bool

AssertForefrontEvents asserts that the expected list of events was received on the actual channel

func Context

func Context(t *testing.T) context.Context

Context returns a new testing context.

If your code relies on the values normally injected into the context by Tool or server, it's a good idea to test it with TestContext to provide adequate replacements.

func ContextWithTimeout

func ContextWithTimeout(t *testing.T, timeout time.Duration) context.Context

ContextWithTimeout is a version of TestContext with a timeout.

If the timeout expires, the test context is closed with context.DeadlineExceeded.

func Group

func Group(t *testing.T) *parallel.Group

Group returns a parallel.Group with a testing context.

If your code relies on the values normally injected into the context by Tool or Server, it's a good idea to test it with TestGroup to provide adequate replacements.

If the group finishes with an error other than context.Canceled, the test is failed.

func GroupWithTimeout

func GroupWithTimeout(t *testing.T, timeout time.Duration) *parallel.Group

GroupWithTimeout is a version of TestGroup with a timeout.

If the timeout expires, the test context is closed with context.DeadlineExceeded.

Types

This section is empty.

Jump to

Keyboard shortcuts

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