(t *testing.T)
| 1566 | } |
| 1567 | |
| 1568 | func 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 | |
| 1596 | func TestDiscoverSkillFiles(t *testing.T) { |
| 1597 | tests := []struct { |
nothing calls this directly
no test coverage detected