MCPcopy Index your code
hub / github.com/cli/cli / TestIsSkillPath

Function TestIsSkillPath

internal/skills/discovery/discovery_test.go:1568–1594  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1566}
1567
1568func TestIsSkillPath(t *testing.T) {
1569 tests := []struct {
1570 name string
1571 path string
1572 want bool
1573 }{
1574 {name: "empty string", path: "", want: false},
1575 {name: "plain skill name", path: "git-commit", want: false},
1576 {name: "bare SKILL.md", path: "SKILL.md", want: false},
1577 {name: "SKILL.md suffix", path: "skills/code-review/SKILL.md", want: true},
1578 {name: "starts with skills/", path: "skills/code-review", want: true},
1579 {name: "starts with plugins/", path: "plugins/hubot/skills/pr-summary", want: true},
1580 {name: "nested skills/ path", path: "terraform/code-generation/skills/terraform-style-guide", want: true},
1581 {name: "deeply nested skills/ path", path: "a/b/c/skills/my-skill", want: true},
1582 {name: "nested plugins/ path", path: "vendor/plugins/hubot/skills/pr-summary", want: true},
1583 {name: "arbitrary nested skill path", path: "packages/agent-skills/netsuite-ai-connector-instructions", want: true},
1584 {name: "arbitrary nested skill path with trailing slash", path: "skills-catalog/matlab-core/matlab-debugging/", want: true},
1585 {name: "name containing skills substring", path: "myskills", want: false},
1586 {name: "namespaced skill name", path: "monalisa/code-review", want: false},
1587 {name: "namespaced path", path: "skills/monalisa/issue-triage", want: true},
1588 }
1589 for _, tt := range tests {
1590 t.Run(tt.name, func(t *testing.T) {
1591 assert.Equal(t, tt.want, IsSkillPath(tt.path))
1592 })
1593 }
1594}
1595
1596func TestDiscoverSkillFiles(t *testing.T) {
1597 tests := []struct {

Callers

nothing calls this directly

Calls 3

IsSkillPathFunction · 0.85
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected