data sim
Namespace of the simulation itself: sim.seed(), sim.rand(1, 6).
Example:
use std.test { sim }
test sim "same seed same numbers" seeds 1..=3 {
let a = sim.rand(1, 6)
assert a >= 1 && a <= 6
}pub(api) data simSince. 1.0.0-beta
Methods
seed | () -> u64The seed of this run (oxl test --seed N). |
rand | (lo: i64, hi: i64) -> i64A deterministic random integer in lo..=hi; the sequence depends only on the seed. |
note | (text: str)Adds a line to the trace of the run (and so to its hash). |
traceHash | () -> u64Hash of everything that happened in the simulated world so far |
Defined in: std/test/test.oxl:357