(t *testing.T)
| 137 | } |
| 138 | |
| 139 | func TestNewIndex(t *testing.T) { |
| 140 | skills := []Skill{ |
| 141 | {Meta: SkillMeta{Name: "a", Keywords: []string{"refactor"}, Languages: []string{"go"}}}, |
| 142 | {Meta: SkillMeta{Name: "b", Keywords: []string{"refactor", "test"}, Languages: []string{"go", "python"}}}, |
| 143 | } |
| 144 | |
| 145 | idx := newIndex(skills) |
| 146 | if len(idx.ByName) != 2 { |
| 147 | t.Errorf("expected 2 names, got %d", len(idx.ByName)) |
| 148 | } |
| 149 | if len(idx.ByKeyword["refactor"]) != 2 { |
| 150 | t.Errorf("expected 2 skills for 'refactor', got %d", len(idx.ByKeyword["refactor"])) |
| 151 | } |
| 152 | if len(idx.ByLanguage["go"]) != 2 { |
| 153 | t.Errorf("expected 2 skills for 'go', got %d", len(idx.ByLanguage["go"])) |
| 154 | } |
| 155 | if len(idx.ByLanguage["python"]) != 1 { |
| 156 | t.Errorf("expected 1 skill for 'python', got %d", len(idx.ByLanguage["python"])) |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | func TestMatchSkills_ByCategory(t *testing.T) { |
| 161 | skills := []Skill{ |
nothing calls this directly
no test coverage detected