MCPcopy Create free account
hub / github.com/github/gh-aw / TestSpinnerDisabledOperations

Function TestSpinnerDisabledOperations

pkg/console/spinner_test.go:162–185  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

160}
161
162func TestSpinnerDisabledOperations(t *testing.T) {
163 // Save original environment
164 origAccessible := os.Getenv("ACCESSIBLE")
165 defer func() {
166 if origAccessible != "" {
167 os.Setenv("ACCESSIBLE", origAccessible)
168 } else {
169 os.Unsetenv("ACCESSIBLE")
170 }
171 }()
172
173 // Force spinner to be disabled
174 os.Setenv("ACCESSIBLE", "1")
175 spinner := NewSpinner("Test message")
176
177 // All operations should be safe when disabled
178 spinner.Start()
179 spinner.UpdateMessage("New message")
180 spinner.Stop()
181 spinner.StopWithMessage("Final message")
182
183 // Check that spinner is disabled
184 _ = spinner
185}
186
187func TestSpinnerRapidStartStop(t *testing.T) {
188 spinner := NewSpinner("Test message")

Callers

nothing calls this directly

Calls 7

GetenvMethod · 0.80
SetenvMethod · 0.80
NewSpinnerFunction · 0.70
StartMethod · 0.45
UpdateMessageMethod · 0.45
StopMethod · 0.45
StopWithMessageMethod · 0.45

Tested by

no test coverage detected