A simple Finite State Machine example - testing
The idea is that as the SM moves between states, it keeps a history of the past states... that's the actual "state". This test will ensure the state is maintained between calls.
send::
msg fsm1.init (id="fsm1"
)
expect:: (status is "init"
)
send::
msg fsm1.move (id="fsm1"
, to="1"
)
expect:: (status is "init-1"
)
send::
msg fsm1.move (id="fsm1"
, to="2"
)
expect:: (status is "init-1-2"
)
send::
msg fsm1.reset (id="fsm1"
)
expect:: (status is ""
)
You need to log in to post a comment!