(t *testing.T)
| 249 | } |
| 250 | |
| 251 | func TestValidateWorkflowIntent(t *testing.T) { |
| 252 | tests := []struct { |
| 253 | name string |
| 254 | input string |
| 255 | expectError bool |
| 256 | errorMsg string |
| 257 | }{ |
| 258 | { |
| 259 | name: "valid minimal intent", |
| 260 | input: "Create a workflow to triage issues", |
| 261 | expectError: false, |
| 262 | }, |
| 263 | { |
| 264 | name: "valid long intent", |
| 265 | input: "Create a comprehensive workflow that automatically triages GitHub issues by analyzing their content, assigning appropriate labels, and notifying relevant team members", |
| 266 | expectError: false, |
| 267 | }, |
| 268 | { |
| 269 | name: "valid exactly 20 characters", |
| 270 | input: "12345678901234567890", |
| 271 | expectError: false, |
| 272 | }, |
| 273 | { |
| 274 | name: "valid with newlines", |
| 275 | input: "Create a workflow to\ntriage issues automatically", |
| 276 | expectError: false, |
| 277 | }, |
| 278 | { |
| 279 | name: "valid with leading/trailing whitespace", |
| 280 | input: " Create a workflow to triage issues ", |
| 281 | expectError: false, |
| 282 | }, |
| 283 | { |
| 284 | name: "empty string", |
| 285 | input: "", |
| 286 | expectError: true, |
| 287 | errorMsg: "workflow instructions cannot be empty", |
| 288 | }, |
| 289 | { |
| 290 | name: "only whitespace", |
| 291 | input: " \t\n ", |
| 292 | expectError: true, |
| 293 | errorMsg: "workflow instructions cannot be empty", |
| 294 | }, |
| 295 | { |
| 296 | name: "only spaces", |
| 297 | input: " ", |
| 298 | expectError: true, |
| 299 | errorMsg: "workflow instructions cannot be empty", |
| 300 | }, |
| 301 | { |
| 302 | name: "only tabs", |
| 303 | input: "\t\t\t", |
| 304 | expectError: true, |
| 305 | errorMsg: "workflow instructions cannot be empty", |
| 306 | }, |
| 307 | { |
| 308 | name: "only newlines", |
nothing calls this directly
no test coverage detected