horsegen: generate data per region

This commit is contained in:
2026-01-15 13:43:54 -05:00
parent 5b5e008b5e
commit d6fb4b6caf
16 changed files with 1287 additions and 2261 deletions

36
go/skill_test.go Normal file
View File

@@ -0,0 +1,36 @@
package horse_test
import (
"cmp"
"slices"
"strings"
"sync"
"testing"
horse "git.sunturtle.xyz/zephyr/horse/go"
"git.sunturtle.xyz/zephyr/horse/go/global"
)
var SortedSkills = sync.OnceValue(func() []horse.Skill {
skills := make([]horse.Skill, 0, len(global.AllSkills))
for _, v := range global.AllSkills {
skills = append(skills, v)
}
slices.SortFunc(skills, func(a, b horse.Skill) int { return cmp.Compare(a.ID, b.ID) })
return skills
})
func TestSkillStrings(t *testing.T) {
t.Parallel()
for _, s := range SortedSkills() {
// We could check that s.ID.String() matches s.Name,
// but that may be awkward for inherited skills.
for _, a := range s.Activations {
for _, abil := range a.Abilities {
if n := abil.Type.String(); strings.HasPrefix(n, "AbilityType(") {
t.Errorf("%v %s: %s", s.ID, s.Name, n)
}
}
}
}
}