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

Function TestSpec_PublicAPI_IsWorkflowSpec

pkg/parser/spec_test.go:91–131  ·  view source on GitHub ↗

TestSpec_PublicAPI_IsWorkflowSpec validates the documented behavior of IsWorkflowSpec as described in the package README.md. Specification: Returns whether a path is a workflow specification markdown file (i.e. of the form owner/repo/path[@ref]).

(t *testing.T)

Source from the content-addressed store, hash-verified

89// Specification: Returns whether a path is a workflow specification markdown file
90// (i.e. of the form owner/repo/path[@ref]).
91func TestSpec_PublicAPI_IsWorkflowSpec(t *testing.T) {
92 tests := []struct {
93 name string
94 input string
95 expected bool
96 }{
97 {
98 name: "owner/repo/path is recognised as workflowspec",
99 input: "github/gh-aw/workflows/build.md",
100 expected: true,
101 },
102 {
103 name: "owner/repo/path@ref is recognised as workflowspec",
104 input: "github/gh-aw/workflows/build.md@main",
105 expected: true,
106 },
107 {
108 name: "local relative path is not a workflowspec",
109 input: ".github/workflows/build.md",
110 expected: false,
111 },
112 {
113 name: "shared/ prefixed path is not a workflowspec",
114 input: "shared/base.md",
115 expected: false,
116 },
117 {
118 name: "single-segment path is not a workflowspec",
119 input: "workflow.md",
120 expected: false,
121 },
122 }
123
124 for _, tt := range tests {
125 t.Run(tt.name, func(t *testing.T) {
126 result := IsWorkflowSpec(tt.input)
127 assert.Equal(t, tt.expected, result,
128 "IsWorkflowSpec(%q) should match documented workflowspec form", tt.input)
129 })
130 }
131}
132
133// TestSpec_InlineSubAgents_GetEngineSubAgentExt validates the documented
134// behavior of GetEngineSubAgentExt as described in the package README.md.

Callers

nothing calls this directly

Calls 2

IsWorkflowSpecFunction · 0.70
RunMethod · 0.45

Tested by

no test coverage detected