package player // Regression: craft recipes declare their skill as the recipe TYPE, and not // every type is a skill (a combine recipe declares "combine"). Callers must be // able to tell a real skill name from an action name, because Level reads an // unknown name as a map miss (level 1) and AddSkillXP persists it. import "testing" func TestValidSkillRecognizesDeclaredSkillsOnly(t *testing.T) { for _, s := range AllSkills { if !ValidSkill(s) { t.Errorf("ValidSkill(%q) = false, want true", s) } } for _, name := range []SkillName{"combine", "fletch", "craft", "", "not_a_skill"} { if ValidSkill(name) { t.Errorf("ValidSkill(%q) = true, want false", name) } } }