| 5 | ) |
| 6 | |
| 7 | func TestAppState_String(t *testing.T) { |
| 8 | tests := []struct { |
| 9 | state AppState |
| 10 | expected string |
| 11 | }{ |
| 12 | {StateReady, "Ready"}, |
| 13 | {StateRunning, "Running"}, |
| 14 | {StatePaused, "Paused"}, |
| 15 | {StateStopped, "Stopped"}, |
| 16 | {StateComplete, "Complete"}, |
| 17 | {StateError, "Error"}, |
| 18 | {AppState(99), "Unknown"}, |
| 19 | } |
| 20 | |
| 21 | for _, tt := range tests { |
| 22 | t.Run(tt.expected, func(t *testing.T) { |
| 23 | if got := tt.state.String(); got != tt.expected { |
| 24 | t.Errorf("AppState.String() = %v, want %v", got, tt.expected) |
| 25 | } |
| 26 | }) |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | func TestStateTransitions_StartFromReady(t *testing.T) { |
| 31 | // Test that we can transition from Ready to Running |