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

Function TestSanitizeWorkflowName

pkg/workflow/strings_test.go:128–212  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

126}
127
128func TestSanitizeWorkflowName(t *testing.T) {
129 tests := []struct {
130 name string
131 input string
132 expected string
133 }{
134 {
135 name: "lowercase conversion",
136 input: "MyWorkflow",
137 expected: "myworkflow",
138 },
139 {
140 name: "spaces to dashes",
141 input: "My Workflow Name",
142 expected: "my-workflow-name",
143 },
144 {
145 name: "colons to dashes",
146 input: "workflow:test",
147 expected: "workflow-test",
148 },
149 {
150 name: "slashes to dashes",
151 input: "workflow/test",
152 expected: "workflow-test",
153 },
154 {
155 name: "backslashes to dashes",
156 input: "workflow\\test",
157 expected: "workflow-test",
158 },
159 {
160 name: "special characters to dashes",
161 input: "workflow@#$test",
162 expected: "workflow-test",
163 },
164 {
165 name: "preserve dots and underscores",
166 input: "workflow.test_name",
167 expected: "workflow.test_name",
168 },
169 {
170 name: "complex name",
171 input: "My Workflow: Test/Build",
172 expected: "my-workflow-test-build",
173 },
174 {
175 name: "empty string",
176 input: "",
177 expected: "",
178 },
179 {
180 name: "only special characters",
181 input: "@#$%^&*()",
182 expected: "-",
183 },
184 {
185 name: "unicode characters",

Callers

nothing calls this directly

Calls 2

SanitizeWorkflowNameFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected