29. Assert once
The assert_once module implements single-time assertion infrastructure.
All functions and symbols are in “assert_once” module, use require to get access to it.
require daslib/assert_once
29.1. Function annotations
- AssertOnceMacro
This macro convert assert_once(expr,message) to the following code:
var __assert_once_I = true // this is a global variable
if __assert_once_I && !expr
__assert_once_I = false
assert(false,message)
29.2. Assertion
- assert_once(expr: bool; message: string = "")
Same as assert, only the check will be not be repeated after the asseretion failed the first time.
- Arguments:
expr : bool
message : string