Skip to content
Playground(another site)

bynk.test.advance_not_clock

Error An advance statement names a capability other than Clock; the test harness owns one time source, the first-party Clock.

advance moves the harness clock, the single time source a test owns, so it names Clock and nothing else. No other capability has virtual time to move. To shape what another capability returns, use a stub. The clock only moves forward.

Example

demo/clock.bynk
consumes bynk { Clock }
// tests/clock.test.bynk
advance Random by 5.minutes // ✗ only the Clock moves
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_not_clock shows the same from the installed toolchain, without a network.