MCPcopy Create free account
hub / github.com/cli/cli / TestMatchesSkillPath

Function TestMatchesSkillPath

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

Source from the content-addressed store, hash-verified

1520}
1521
1522func TestMatchesSkillPath(t *testing.T) {
1523 tests := []struct {
1524 name string
1525 path string
1526 wantName string
1527 }{
1528 {name: "skills convention", path: "skills/code-review/SKILL.md", wantName: "code-review"},
1529 {name: "namespaced convention", path: "skills/monalisa/issue-triage/SKILL.md", wantName: "issue-triage"},
1530 {name: "plugins convention", path: "plugins/hubot/skills/pr-summary/SKILL.md", wantName: "pr-summary"},
1531 {name: "non-skill file", path: "README.md", wantName: ""},
1532 {name: "non-SKILL.md in skill dir", path: "skills/code-review/prompt.txt", wantName: ""},
1533 {name: "nested skills convention", path: "terraform/code-generation/skills/terraform-style-guide/SKILL.md", wantName: "terraform-style-guide"},
1534 }
1535 for _, tt := range tests {
1536 t.Run(tt.name, func(t *testing.T) {
1537 assert.Equal(t, tt.wantName, MatchesSkillPath(tt.path))
1538 })
1539 }
1540}
1541
1542func TestMatchSkillPath(t *testing.T) {
1543 tests := []struct {

Callers

nothing calls this directly

Calls 3

MatchesSkillPathFunction · 0.85
EqualMethod · 0.80
RunMethod · 0.65

Tested by

no test coverage detected