package
Version:
v0.12.0
Opens a new window with list of versions in this module.
Published: May 2, 2024
License: MPL-2.0
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package assert implements assertions for the standard testing package.
-
func AsErr[T Param](t TB, err error, target any, formatAndArgs ...any)
-
func Equal[T Param, V any](t TB, got, want V, formatAndArgs ...any)
-
func IsErr[T Param](t TB, err, target error, formatAndArgs ...any)
-
func NoErr[T Param](t TB, err error, formatAndArgs ...any)
-
func Panics[T Param](t TB, fn func(), v any, formatAndArgs ...any)
-
type E
-
type F
-
type Param
-
type TB
AsErr asserts that errors.As(err, target) is true.
func Equal[T Param, V any](t TB, got, want V, formatAndArgs ...any)
Equal asserts that two values are equal.
IsErr asserts that errors.Is(err, target) is true.
NoErr asserts that the error is nil.
func Panics[T Param](t TB, fn func(), v any, formatAndArgs ...any)
Panics asserts that the given function panics with the argument v.
If v is nil, the panic argument is ignored.
Param controls the behavior of an assertion if it fails.
Either E or F must be specified as the type parameter.
Source Files
¶
Directories
¶
Package EF provides type aliases for the parent [assert] package.
|
Package EF provides type aliases for the parent [assert] package. |
Click to show internal directories.
Click to hide internal directories.