TestSpec_PublicAPI_ValidateWorkflowIntent validates the documented validation rules. Spec: "Validates the workflow intent string"
(t *testing.T)
| 306 | // TestSpec_PublicAPI_ValidateWorkflowIntent validates the documented validation rules. |
| 307 | // Spec: "Validates the workflow intent string" |
| 308 | func TestSpec_PublicAPI_ValidateWorkflowIntent(t *testing.T) { |
| 309 | tests := []struct { |
| 310 | name string |
| 311 | input string |
| 312 | wantErr bool |
| 313 | }{ |
| 314 | { |
| 315 | name: "empty string returns error", |
| 316 | input: "", |
| 317 | wantErr: true, |
| 318 | }, |
| 319 | { |
| 320 | name: "whitespace-only string returns error", |
| 321 | input: " ", |
| 322 | wantErr: true, |
| 323 | }, |
| 324 | { |
| 325 | name: "string shorter than 20 characters returns error", |
| 326 | input: "too short", |
| 327 | wantErr: true, |
| 328 | }, |
| 329 | { |
| 330 | name: "string of exactly 20 characters is valid", |
| 331 | input: "twelve chars here!!!", |
| 332 | wantErr: false, |
| 333 | }, |
| 334 | { |
| 335 | name: "string longer than 20 characters is valid", |
| 336 | input: "This is a sufficiently long workflow intent description", |
| 337 | wantErr: false, |
| 338 | }, |
| 339 | } |
| 340 | |
| 341 | for _, tt := range tests { |
| 342 | t.Run(tt.name, func(t *testing.T) { |
| 343 | err := cli.ValidateWorkflowIntent(tt.input) |
| 344 | if tt.wantErr { |
| 345 | assert.Error(t, err, "ValidateWorkflowIntent(%q) should return error", tt.input) |
| 346 | } else { |
| 347 | assert.NoError(t, err, "ValidateWorkflowIntent(%q) should not return error", tt.input) |
| 348 | } |
| 349 | }) |
| 350 | } |
| 351 | } |
| 352 | |
| 353 | // TestSpec_PublicAPI_UpdateFieldInFrontmatter validates the documented frontmatter field update. |
| 354 | // Spec: "Sets a field in frontmatter YAML" |
nothing calls this directly
no test coverage detected