Assert¶
Import: import system.testing;
Read the usage guide for examples and common tasks. This reference lists the public declarations for this part of the library. See Reading API signatures for parameter and result notation.
Assert¶
Assertion helpers for system.testing. On failure, prints a message and exits the process with a non-zero status (no exceptions/panics — assertions are meant to run in ordinary scripts). Exit-based failures require a real process model (@native / @node); not available on @web.
fail¶
Fails the current test run with message: prints it and terminates the process with a non-zero exit code. There is no exception mechanism to unwind through, so Assert.* failures are unrecoverable by design (matching System.panic).
eq_async¶
Awaits actual and compares its value using the normal assertion diagnostics.
ok_async¶
Awaits a fallible operation and returns its success value, reporting the error on failure.
eq¶
Asserts that actual == expected. String failures quote the expected and actual values.
ne¶
Asserts that actual != expected.
is_true¶
Asserts that value is true.
is_false¶
Asserts that value is false.
approx¶
Asserts that two doubles are within epsilon of each other.