MCPcopy Create free account
hub / github.com/github/gh-aw / TestIsCustomAgentFile

Function TestIsCustomAgentFile

pkg/parser/frontmatter_utils_test.go:64–118  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

62}
63
64func TestIsCustomAgentFile(t *testing.T) {
65 tests := []struct {
66 name string
67 filePath string
68 expected bool
69 }{
70 {
71 name: "file under .github/agents with .md extension",
72 filePath: "/some/path/.github/agents/test-agent.md",
73 expected: true,
74 },
75 {
76 name: "file under .github/agents with .agent.md extension",
77 filePath: "/some/path/.github/agents/feature-flag-remover.agent.md",
78 expected: true,
79 },
80 {
81 name: "file under .github/agents subdirectory",
82 filePath: "/some/path/.github/agents/subdir/helper.md",
83 expected: true, // Still an agent file even in subdirectory
84 },
85 {
86 name: "file outside .github/agents",
87 filePath: "/some/path/docs/instructions.md",
88 expected: false,
89 },
90 {
91 name: "file in .github/workflows",
92 filePath: "/some/path/.github/workflows/test.md",
93 expected: false,
94 },
95 {
96 name: "file in .github but not agents",
97 filePath: "/some/path/.github/ISSUE_TEMPLATE/bug.md",
98 expected: false,
99 },
100 {
101 name: "relative path under agents",
102 filePath: ".github/agents/test-agent.md",
103 expected: true,
104 },
105 {
106 name: "file under agents but not markdown",
107 filePath: ".github/agents/config.json",
108 expected: false,
109 },
110 }
111
112 for _, tt := range tests {
113 t.Run(tt.name, func(t *testing.T) {
114 result := isCustomAgentFile(tt.filePath)
115 assert.Equal(t, tt.expected, result, "isCustomAgentFile(%q)", tt.filePath)
116 })
117 }
118}
119
120func TestResolveIncludePath(t *testing.T) {
121 // Create temporary directory structure

Callers

nothing calls this directly

Calls 2

isCustomAgentFileFunction · 0.70
RunMethod · 0.45

Tested by

no test coverage detected