Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v0 source pure

v0 - Unaudited: This is an initial version that has not yet been formally audited. A fully audited version will be pu...

Readme View source

v0 - Unaudited This is an initial version of this package that has not yet been formally audited. A fully audited version will be published as a subsequent release. Use in production at your own risk.

urequire

Package urequire provides test assertion functions that immediately fail the test on error, complementing the uassert package.

Overview

v0 - Unaudited: This is an initial version that has not yet been formally audited. A fully audited version will be published as a subsequent release. Use in production at your own risk.

Package urequire provides test assertion functions that immediately fail the test on error, complementing the uassert package.

urequire is a sister package for uassert. XXX: codegen the package.

Functions 20

func AbortsContains

1func AbortsContains(t uassert.TestingT, rlm realm, substr string, f any, msgs ...string)
source

AbortsContains requires that the code inside the specified func aborts (panics when crossing another realm) and the abort message contains the specified substring. See uassert.AbortsWithMessage for `rlm` semantics.

func AbortsWithMessage

1func AbortsWithMessage(t uassert.TestingT, rlm realm, msg string, f any, msgs ...string)
source

AbortsWithMessage requires that the code inside the specified func aborts (panics when crossing another realm). Use PanicsWithMessage for requiring local panics within the same realm. Note: This relies on gno's `revive` mechanism to catch aborts. See uassert.AbortsWithMessage for `rlm` semantics.

func Empty

1func Empty(t uassert.TestingT, obj any, msgs ...string)
source

Empty requires that the specified object is empty (zero value, empty string/slice/map, or nil).

func Equal

1func Equal(t uassert.TestingT, expected, actual any, msgs ...string)
source

Equal requires that two objects are equal.

func Error

1func Error(t uassert.TestingT, err error, msgs ...string)
source

Error requires that a function returned an error (i.e. not `nil`).

func ErrorContains

1func ErrorContains(t uassert.TestingT, err error, contains string, msgs ...string)
source

ErrorContains requires that a function returned an error (i.e. not `nil`) and that the error contains the specified substring.

func ErrorIs

1func ErrorIs(t uassert.TestingT, err, target error, msgs ...string)
source

ErrorIs requires that the given error matches the target error.

func False

1func False(t uassert.TestingT, value bool, msgs ...string)
source

False requires that the specified value is false.

func Nil

1func Nil(t uassert.TestingT, value any, msgs ...string)
source

Nil requires that the value is nil.

func NoError

1func NoError(t uassert.TestingT, err error, msgs ...string)
source

NoError requires that a function returned no error (i.e. `nil`).

func NotAborts

1func NotAborts(t uassert.TestingT, rlm realm, f any, msgs ...string)
source

NotAborts requires that the code inside the specified func does NOT abort when crossing an execution boundary (e.g., VM call). Use NotPanics for requiring the absence of local panics within the same realm. Note: This relies on Gno's `revive` mechanism. See uassert.AbortsWithMessage for `rlm` semantics.

func NotEmpty

1func NotEmpty(t uassert.TestingT, obj any, msgs ...string)
source

NotEmpty requires that the specified object is not empty.

func NotEqual

1func NotEqual(t uassert.TestingT, expected, actual any, msgs ...string)
source

NotEqual requires that two objects are not equal.

func NotNil

1func NotNil(t uassert.TestingT, value any, msgs ...string)
source

NotNil requires that the value is not nil.

func NotPanics

1func NotPanics(t uassert.TestingT, rlm realm, f any, msgs ...string)
source

NotPanics requires that the code inside the specified func does NOT panic locally within the same execution realm. Use NotAborts for requiring the absence of panics that cross execution boundaries (aborts). See uassert.AbortsWithMessage for `rlm` semantics.

func NotTypedNil

1func NotTypedNil(t uassert.TestingT, value any, msgs ...string)
source

NotTypedNil requires that the value is not a typed-nil (nil pointer) value.

func PanicsContains

1func PanicsContains(t uassert.TestingT, rlm realm, substr string, f any, msgs ...string)
source

PanicsContains requires that the code inside the specified func panics locally within the same execution realm and the panic message contains the specified substring. See uassert.AbortsWithMessage for `rlm` semantics.

func PanicsWithMessage

1func PanicsWithMessage(t uassert.TestingT, rlm realm, msg string, f any, msgs ...string)
source

PanicsWithMessage requires that the code inside the specified func panics locally within the same execution realm. Use AbortsWithMessage for requiring panics that cross execution boundaries (aborts). See uassert.AbortsWithMessage for `rlm` semantics.

func True

1func True(t uassert.TestingT, value bool, msgs ...string)
source

True requires that the specified value is true.

func TypedNil

1func TypedNil(t uassert.TestingT, value any, msgs ...string)
source

TypedNil requires that the value is a typed-nil (nil pointer) value.

Imports 1

Source Files 5