(t *testing.T)
| 186 | } |
| 187 | |
| 188 | func TestSkillHandlerPinnedNames_AlphabeticalOrder(t *testing.T) { |
| 189 | sh, _ := newPinTestFixture(t, map[string]string{ |
| 190 | "alpha": makeSkill("alpha", false), |
| 191 | "bravo": makeSkill("bravo", false), |
| 192 | "charlie": makeSkill("charlie", false), |
| 193 | }) |
| 194 | // Pin out of order |
| 195 | sh.Pin("charlie") |
| 196 | sh.Pin("alpha") |
| 197 | sh.Pin("bravo") |
| 198 | |
| 199 | got := sh.PinnedNames() |
| 200 | want := []string{"alpha", "bravo", "charlie"} |
| 201 | if len(got) != len(want) { |
| 202 | t.Fatalf("len = %d, want %d. got=%v", len(got), len(want), got) |
| 203 | } |
| 204 | if !sort.StringsAreSorted(got) { |
| 205 | t.Fatalf("PinnedNames must be alphabetically sorted for cache stability; got %v", got) |
| 206 | } |
| 207 | for i := range want { |
| 208 | if got[i] != want[i] { |
| 209 | t.Fatalf("PinnedNames[%d] = %q, want %q", i, got[i], want[i]) |
| 210 | } |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | func TestSkillHandlerGetPinnedSkills_Success(t *testing.T) { |
| 215 | sh, _ := newPinTestFixture(t, map[string]string{ |
nothing calls this directly
no test coverage detected