MCPcopy Index your code
hub / github.com/MiniCodeMonkey/chief / TestAppState_String

Function TestAppState_String

internal/tui/state_test.go:7–28  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

5)
6
7func 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
30func TestStateTransitions_StartFromReady(t *testing.T) {
31 // Test that we can transition from Ready to Running

Callers

nothing calls this directly

Calls 3

AppStateTypeAlias · 0.85
RunMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected