This commit is contained in:
2026-05-26 07:17:05 +02:00
parent 6895b69a1f
commit e893963743
27 changed files with 412 additions and 436 deletions

29
lib/build_test.go Normal file
View File

@@ -0,0 +1,29 @@
package lib
import "testing"
// TestBuildValidates is the headless smoke test: it composes the full
// game and asks the library to cross-check every name reference
// between managers. No window opens.
func TestBuildValidates(t *testing.T) {
g := Build()
if err := g.Validate(); err != nil {
t.Fatalf("validate: %v", err)
}
for _, name := range []string{"bedroom", "kitchen"} {
if !g.SceneManager.Has(name) {
t.Errorf("missing scene %q", name)
}
}
for _, name := range []string{"key", "beans", "mug"} {
if !g.ItemManager.Has(name) {
t.Errorf("missing item %q", name)
}
}
if !g.DialogueManager.Has("cat_morning") {
t.Errorf("missing dialogue cat_morning")
}
if !g.ScriptManager.Has("intro") || !g.ScriptManager.Has("victory") {
t.Errorf("missing intro/victory script")
}
}