(t *testing.T)
| 160 | } |
| 161 | |
| 162 | func 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 | |
| 187 | func TestSpinnerRapidStartStop(t *testing.T) { |
| 188 | spinner := NewSpinner("Test message") |
nothing calls this directly
no test coverage detected