(t *testing.T)
| 17 | } |
| 18 | |
| 19 | func TestConnStateMachine_Transition(t *testing.T) { |
| 20 | sm := NewConnStateMachine() |
| 21 | |
| 22 | // Unconditional transition |
| 23 | sm.Transition(StateInitializing) |
| 24 | if state := sm.GetState(); state != StateInitializing { |
| 25 | t.Errorf("expected state to be INITIALIZING, got %s", state) |
| 26 | } |
| 27 | |
| 28 | sm.Transition(StateIdle) |
| 29 | if state := sm.GetState(); state != StateIdle { |
| 30 | t.Errorf("expected state to be IDLE, got %s", state) |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | func TestConnStateMachine_TryTransition(t *testing.T) { |
| 35 | tests := []struct { |
nothing calls this directly
no test coverage detected