MCPcopy Create free account
hub / github.com/diillson/chatcli / TestSkillHandlerPinnedNames_AlphabeticalOrder

Function TestSkillHandlerPinnedNames_AlphabeticalOrder

cli/skill_pin_test.go:188–212  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

186}
187
188func 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
214func TestSkillHandlerGetPinnedSkills_Success(t *testing.T) {
215 sh, _ := newPinTestFixture(t, map[string]string{

Callers

nothing calls this directly

Calls 4

newPinTestFixtureFunction · 0.85
makeSkillFunction · 0.85
PinMethod · 0.80
PinnedNamesMethod · 0.80

Tested by

no test coverage detected