on main help sign in
feat: remove test file
commitea9491078f7fb69546479bce174ec9501069d465 authorRaphael Amorim <rapha850@gmail.com> dateMon 16 Jun 2025, 23:10 (1 year ago) parent69b649d
2 files changed+3−66
internal/tui/components/anim/anim.go+3−3 internal/tui/components/anim/anim_test.go−63
internal/tui/components/anim/anim.go+3−3
@@ -17,9 +17,9 @@ import (
1717)
1818
1919const (
20− charCyclingFPS = time.Second / 8 // Reduced from 22 to 8 FPS for better CPU efficiency
21− colorCycleFPS = time.Second / 3 // Reduced from 5 to 3 FPS
22− maxCyclingChars = 60 // Reduced from 120 to 60 characters
20+ charCyclingFPS = time.Second / 8 // 8 FPS for better CPU efficiency
21+ colorCycleFPS = time.Second / 3 // 3 FPS
22+ maxCyclingChars = 60 // 60 characters
2323)
2424
2525var (
internal/tui/components/anim/anim_test.godeleted−63
@@ -1,63 +0,0 @@
1−package anim
2−
3−import (
4− "testing"
5− "time"
6−)
7−
8−func BenchmarkAnimationUpdate(b *testing.B) {
9− anim := New(30, "Loading test data")
10−
11− b.ResetTimer()
12− for i := 0; i < b.N; i++ {
13− // Simulate character cycling update
14− _, _ = anim.Update(StepCharsMsg{id: anim.ID()})
15− }
16−}
17−
18−func BenchmarkAnimationView(b *testing.B) {
19− anim := New(30, "Loading test data")
20−
21− // Initialize with some cycling
22− for i := 0; i < 10; i++ {
23− anim.Update(StepCharsMsg{id: anim.ID()})
24− }
25−
26− b.ResetTimer()
27− for i := 0; i < b.N; i++ {
28− _ = anim.View()
29− }
30−}
31−
32−func BenchmarkRandomRune(b *testing.B) {
33− c := cyclingChar{}
34−
35− b.ResetTimer()
36− for i := 0; i < b.N; i++ {
37− _ = c.randomRune()
38− }
39−}
40−
41−func TestAnimationPerformance(t *testing.T) {
42− anim := New(30, "Performance test")
43−
44− start := time.Now()
45− iterations := 1000
46−
47− // Simulate rapid updates
48− for i := 0; i < iterations; i++ {
49− anim.Update(StepCharsMsg{id: anim.ID()})
50− _ = anim.View()
51− }
52−
53− duration := time.Since(start)
54− avgPerUpdate := duration / time.Duration(iterations)
55−
56− // Should complete 1000 updates in reasonable time
57− if avgPerUpdate > time.Millisecond {
58− t.Errorf("Animation update too slow: %v per update (should be < 1ms)", avgPerUpdate)
59− }
60−
61− t.Logf("Animation performance: %v per update (%d updates in %v)",
62− avgPerUpdate, iterations, duration)
63−}