(t *testing.T)
| 126 | } |
| 127 | |
| 128 | func 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", |
nothing calls this directly
no test coverage detected