MCPcopy
hub / github.com/redis/go-redis / TestConnStateMachine_Transition

Function TestConnStateMachine_Transition

internal/pool/conn_state_test.go:19–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

17}
18
19func 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
34func TestConnStateMachine_TryTransition(t *testing.T) {
35 tests := []struct {

Callers

nothing calls this directly

Calls 3

TransitionMethod · 0.95
GetStateMethod · 0.95
NewConnStateMachineFunction · 0.85

Tested by

no test coverage detected