Skip to content
Playground(another site)

bynk.test.advance_outside_case

Error An advance Clock by statement appears outside a test case body; only the test harness has a clock to move.

advance Clock by … moves the harness clock, which only a case owns. A property runs its body once per generated input and has no clock of its own, and non-test code reads real time. Put the time-dependent step in a case. bynk.test.advance_not_clock and bynk.test.advance_not_duration cover the other ways to get advance wrong.

Example

property "time moves on" {
for all n: Int {
advance Clock by 5.minutes // ✗ a property has no clock
}
}
case "time moves on" {
advance Clock by 5.minutes // ✓
}

In the Book

See also

  • The grammar rule it governs: advance_stmt.
  • Every code in its category, Tests, on the diagnostic index.
  • bynk explain bynk.test.advance_outside_case shows the same from the installed toolchain, without a network.