testutil

package
v0.0.0-...-c966403 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertEqual

func AssertEqual(
	t *testing.T,
	expected, actual interface{},
	opts ...cmp.Option,
)

AssertEqual checks if the expected and actual are equal. Errors if not.

func AssertErrorAs

func AssertErrorAs[T any](t *testing.T, err error, msg ...string)

AsserterrorAs checks if the error is another error.

func AssertErrorIs

func AssertErrorIs(t *testing.T, err, expErr error, msg ...string)

AssertErrorIs checks if the error is another error.

func AssertNoError

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

AssertNoError checks if the error is nil.

func AssertTrue

func AssertTrue(t *testing.T, condition bool, msg ...string)

AssertTrue checks if the condition is true. Errors if not.

func Callers

func Callers() string

Callers prints the stack trace of everything up til the line where Callers() was invoked.

func Diff

func Diff[T any](got, want T, opts ...cmp.Option) string

Diff compares two items and returns a human-readable diff string. If the items are equal, the string is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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