added tests for state_machine