require

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package require provides assertion helpers that stop test execution on failure. For assertions that should allow the test to continue on failure, use the `assert` package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Panic

func Panic(t internal.TestingT, fn func(), expr string, msg ...string)

Panic asserts that fn panics and the panic message matches expr. It reports an error if fn does not panic or if the recovered message does not satisfy expr.

func That

func That(t internal.TestingT, v any) *assert.Assertion

That creates an Assertion for the given value v and test context t.

func ThatError

func ThatError(t internal.TestingT, v error) *assert.ErrorAssertion

ThatError returns a new ErrorAssertion for the given error value.

func ThatMap

func ThatMap[K, V comparable](t internal.TestingT, v map[K]V) *assert.MapAssertion[K, V]

ThatMap returns a MapAssertion for the given testing object and map value.

func ThatNumber

func ThatNumber[T assert.Number](t internal.TestingT, v T) *assert.NumberAssertion[T]

ThatNumber returns a NumberAssertion for the given testing object and number value.

func ThatSlice

func ThatSlice[T comparable](t internal.TestingT, v []T) *assert.SliceAssertion[T]

ThatSlice returns a SliceAssertion for the given testing object and slice value.

func ThatString

func ThatString(t internal.TestingT, v string) *assert.StringAssertion

ThatString returns a StringAssertion for the given testing object and string value.

Types

This section is empty.

Jump to

Keyboard shortcuts

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