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

Function TestSpec_PublicAPI_NormalizeWorkflowName

pkg/stringutil/spec_test.go:254–284  ·  view source on GitHub ↗

TestSpec_PublicAPI_NormalizeWorkflowName validates the documented behavior of NormalizeWorkflowName as described in the package README.md. Specification examples: stringutil.NormalizeWorkflowName("weekly-research.md") // "weekly-research" stringutil.NormalizeWorkflowName("weekly-research.l

(t *testing.T)

Source from the content-addressed store, hash-verified

252// stringutil.NormalizeWorkflowName("weekly-research.lock.yml") // "weekly-research"
253// stringutil.NormalizeWorkflowName("weekly-research") // "weekly-research"
254func TestSpec_PublicAPI_NormalizeWorkflowName(t *testing.T) {
255 tests := []struct {
256 name string
257 input string
258 expected string
259 }{
260 {
261 name: "removes .md extension (documented example)",
262 input: "weekly-research.md",
263 expected: "weekly-research",
264 },
265 {
266 name: "removes .lock.yml extension (documented example)",
267 input: "weekly-research.lock.yml",
268 expected: "weekly-research",
269 },
270 {
271 name: "no extension returned unchanged (documented example)",
272 input: "weekly-research",
273 expected: "weekly-research",
274 },
275 }
276
277 for _, tt := range tests {
278 t.Run(tt.name, func(t *testing.T) {
279 result := NormalizeWorkflowName(tt.input)
280 assert.Equal(t, tt.expected, result,
281 "NormalizeWorkflowName(%q) should match documented output", tt.input)
282 })
283 }
284}
285
286// TestSpec_PublicAPI_NormalizeSafeOutputIdentifier validates the documented
287// behavior of NormalizeSafeOutputIdentifier as described in the package README.md.

Callers

nothing calls this directly

Calls 2

NormalizeWorkflowNameFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected