Tests.Assert
Tests.Assert
Module tests.assert
import tests.assert
| Module | tests.assert |
| Source | tests/assert/basic.zirr, tests/assert/module-docs.zirr |
Assertions are values, not control flow.
An assertion here returns a prelude.Result rather than aborting. A test returns one, and that is its outcome — so a failure is an ordinary value you can pass around, and all combines several into one.
Because they are values, nothing stops after the first failure unless you make it. Return a single assertion for a single check, or gather several with all to report every one.
Dependencies
Contents
Functions
all
`tests/assert/basic.zirr:6`
fn all(res: [@AnyResult]) -> Result
equal
`tests/assert/basic.zirr:10`
fn equal(expect, got) -> Result
fail
`tests/assert/basic.zirr:71`
fn fail(reason) -> Result
isErr
`tests/assert/basic.zirr:45`
fn isErr(val) -> Result
isError
`tests/assert/basic.zirr:62`
fn isError(val) -> Result
isFalse
`tests/assert/basic.zirr:22`
fn isFalse(val) -> Result
isOk
`tests/assert/basic.zirr:26`
fn isOk(val) -> Result
isTrue
`tests/assert/basic.zirr:18`
fn isTrue(val) -> Result