OxL Reference

method clock.set

Moves virtual time forward to t (time never goes back).

Example:

oxl✓ checked in CI
use std.test { clock }
use std.time { Time }

test sim "jump to a date" seeds 1..=2 {
  clock.set(Time.ofUnixSeconds(1893456000))
  assert clock.now().unixSeconds() >= 1893456000
}
pub(api) static fn set(t: Tm)

Since. 1.0.0-beta

Parameters

NameType
tTm

Effects

none declared (pure unless the body says otherwise)

Defined in: std/test/test.oxl:328

See also