fsm-story Pub Share

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 "")


Was this useful?    

By: Razie | 2016-06-26 .. 2017-05-01 | Tags: story , dsl , engine


Viewed 1008 times ( | History | Print ) this page.

You need to log in to post a comment!

© Copyright DieselApps, 2012-2024, all rights reserved.