add tests for state_machine