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

Function TestNormalizeWorkflowName

pkg/workflow/resolve_test.go:37–81  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

35}
36
37func TestNormalizeWorkflowName(t *testing.T) {
38 tests := []struct {
39 name string
40 input string
41 expected string
42 }{
43 {
44 name: "plain name",
45 input: "weekly-research",
46 expected: "weekly-research",
47 },
48 {
49 name: "name with .md extension",
50 input: "weekly-research.md",
51 expected: "weekly-research",
52 },
53 {
54 name: "name with .lock.yml extension",
55 input: "weekly-research.lock.yml",
56 expected: "weekly-research",
57 },
58 {
59 name: "empty string",
60 input: "",
61 expected: "",
62 },
63 {
64 name: "name with multiple dots",
65 input: "daily-test.coverage.md",
66 expected: "daily-test.coverage",
67 },
68 {
69 name: "name ending with partial extension",
70 input: "workflow.lock",
71 expected: "workflow.lock",
72 },
73 }
74
75 for _, tt := range tests {
76 t.Run(tt.name, func(t *testing.T) {
77 result := stringutil.NormalizeWorkflowName(tt.input)
78 assert.Equal(t, tt.expected, result, "NormalizeWorkflowName(%q) should return %q", tt.input, tt.expected)
79 })
80 }
81}
82
83func TestResolveWorkflowName(t *testing.T) {
84 workflowsDir := setupWorkflowDir(t)

Callers

nothing calls this directly

Calls 2

NormalizeWorkflowNameFunction · 0.92
RunMethod · 0.45

Tested by

no test coverage detected