diff --git a/transition_test.go b/transition_test.go index 5a780ff..f7d0fe2 100644 --- a/transition_test.go +++ b/transition_test.go @@ -61,3 +61,14 @@ func TestTransitionSubscribe(t *testing.T) { t.Errorf("Invalid enter event") } } + +func TestTransitionMultipleSourceStates(t *testing.T) { + tr := NewTransition("open", States("closed", "disconnected"), "opened") + assert.NotNil(t, tr) + mc := setupModel("closed") + assert.Nil(t, tr.Run(mc)) + assert.Equal(t, "opened", string(mc.InspectState())) + md := setupModel("disconnected") + assert.Nil(t, tr.Run(md)) + assert.Equal(t, "opened", string(md.InspectState())) +}