testutil

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertContains

func AssertContains[T comparable](t *testing.T, slice []T, value T, message string)

AssertContains fails the test if the slice doesn't contain the value.

func AssertEqual

func AssertEqual[T comparable](t *testing.T, actual, expected T, message string)

AssertEqual fails the test if actual != expected.

func AssertError

func AssertError(t *testing.T, err error, message string)

AssertError fails the test if err is nil.

func AssertNoError

func AssertNoError(t *testing.T, err error, message string)

AssertNoError fails the test if err is not nil.

func Eventually

func Eventually(t *testing.T, condition func() bool, timeout time.Duration, message string)

Eventually waits for a condition to be true within the timeout period. It checks the condition every 10ms until it returns true or the timeout expires.

func EventuallyEqual

func EventuallyEqual[T comparable](t *testing.T, getter func() T, expected T, timeout time.Duration)

EventuallyEqual waits for a function to return the expected value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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