func AbortsContains
AbortsContains asserts that the code inside the specified func aborts (panics when crossing another realm) and the abort message contains the specified substring. See AbortsWithMessage for `rlm` semantics.
v0 - Unaudited: This is an initial version that has not yet been formally audited. A fully audited version will be pu...
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.
Package uassert provides assertion helpers for testing Gno packages and realms.
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.
uassert is an adapted lighter version of https://github.com/stretchr/testify/assert.
AbortsContains asserts that the code inside the specified func aborts (panics when crossing another realm) and the abort message contains the specified substring. See AbortsWithMessage for `rlm` semantics.
AbortsWithMessage asserts that the code inside the specified func aborts (panics when crossing another realm). Use PanicsWithMessage for asserting local panics within the same realm.
`rlm` is threaded into the callback via cross(rlm) when f is func(realm). It is ignored for func() callbacks. /p/ production code cannot declare crossing functions, so rlm is taken as the second (non-first) parameter — callers pass `cur` directly.
NOTE: This relies on gno's `revive` mechanism to catch aborts.
Equal asserts that two objects are equal.
Error asserts that a function returned an error (i.e. not `nil`).
ErrorContains asserts that a function returned an error (i.e. not `nil`) and that the error contains the specified substring.
ErrorIs asserts the given error matches the target error using errors.Is, which traverses the error chain looking for a match.
False asserts that the specified value is false.
Nil asserts that the value is nil.
NoError asserts that a function returned no error (i.e. `nil`).
NotAborts asserts that the code inside the specified func does NOT abort when crossing an execution boundary. Note: Consider using NotPanics which checks for both panics and aborts. See AbortsWithMessage for `rlm` semantics.
NotEqual asserts that two objects are not equal.
NotNil asserts that the value is not nil.
NotPanics asserts that the code inside the specified func does NOT panic (within the same realm) or abort (due to a cross-realm panic). See AbortsWithMessage for `rlm` semantics.
NotTypedNil asserts that the value is not a typed-nil (nil pointer) value.
PanicsContains asserts that the code inside the specified func panics locally within the same execution realm and the panic message contains the specified substring. See AbortsWithMessage for `rlm` semantics.
PanicsWithMessage asserts that the code inside the specified func panics locally within the same execution realm. Use AbortsWithMessage for asserting panics that cross execution boundaries (aborts). See AbortsWithMessage for `rlm` semantics.
True asserts that the specified value is true.
TypedNil asserts that the value is a typed-nil (nil pointer) value.