TestClock
Deterministic Clock for time-sensitive tests.
Tests that need to control the passage of time without relying on runTest's virtual scheduler — for instance, when verifying InMemoryStorage timestamps or asserting on time-stamped state — can construct a TestClock, pass it to the system under test, and call advance or set to move virtual wall-clock time forward.
val clock = TestClock(initial = Instant.fromEpochMilliseconds(1_700_000_000_000))
val storage = InMemoryStorage(clock = clock)
storage.saveNode(node)
clock.advance(5.seconds)
// storage entries written before advance() have timestamps 5s in the pastContent copied to clipboard
Not thread-safe; intended for single-threaded test usage.
Since
0.1.0