-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_test.go
42 lines (33 loc) · 939 Bytes
/
main_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package main
import (
"context"
"testing"
"go-poem-project/internal/animation"
"go-poem-project/internal/instrumentation"
"go-poem-project/internal/poem"
)
func TestMainFunction(t *testing.T) {
ctx := context.Background()
// Mock instrumentation
instOptions := []instrumentation.Option{}
inst, err := instrumentation.NewInstrumentation(ctx, instOptions...)
if err != nil {
t.Fatalf("failed to create instrumentation: %v", err)
}
err = inst.Load(ctx)
if err != nil {
t.Fatalf("failed to load instrumentation: %v", err)
}
if err = inst.Run(ctx); err != nil {
t.Fatalf("instrumentation crashed: %v", err)
}
defer inst.Shutdown(ctx)
// Test poem generation
poemText := poem.ForHer()
if poemText == "" {
t.Error("expected poem text, got empty string")
}
// Test animation
// Note: Since animation.PrintStarrySky() prints to stdout, you might want to capture stdout in tests
animation.PrintStarrySky()
}