spinner_test.go 342 B

123456789101112131415161718192021222324
  1. package spinner
  2. import (
  3. "testing"
  4. "time"
  5. )
  6. func TestSpinner(t *testing.T) {
  7. t.Parallel()
  8. // Create a spinner
  9. s := NewSpinner("Test spinner")
  10. // Start the spinner
  11. s.Start()
  12. // Wait a bit to let it run
  13. time.Sleep(100 * time.Millisecond)
  14. // Stop the spinner
  15. s.Stop()
  16. // If we got here without panicking, the test passes
  17. }