(t *testing.T)
| 436 | } |
| 437 | |
| 438 | func TestValidate_StrictMode(t *testing.T) { |
| 439 | task := &model.Task{ |
| 440 | ID: "001", |
| 441 | Title: "Test Task", |
| 442 | // Missing optional fields: Status, Priority, Effort, Group, Tags, Body |
| 443 | } |
| 444 | |
| 445 | // Non-strict mode should not produce warnings |
| 446 | v := NewValidator(false) |
| 447 | result := v.Validate([]*model.Task{task}) |
| 448 | |
| 449 | if result.Warnings > 0 { |
| 450 | t.Errorf("Non-strict mode should not produce warnings, got %d", result.Warnings) |
| 451 | } |
| 452 | |
| 453 | // Strict mode should produce warnings for missing optional fields |
| 454 | vStrict := NewValidator(true) |
| 455 | resultStrict := vStrict.Validate([]*model.Task{task}) |
| 456 | |
| 457 | // Should have warnings for: status, priority, effort, group, tags, body = 6 warnings |
| 458 | if resultStrict.Warnings < 5 { |
| 459 | t.Errorf("Strict mode should produce multiple warnings, got %d", resultStrict.Warnings) |
| 460 | for _, issue := range resultStrict.Issues { |
| 461 | t.Logf(" Issue: [%s] %s", issue.Level, issue.Message) |
| 462 | } |
| 463 | } |
| 464 | } |
| 465 | |
| 466 | func TestValidationResult_IsValid(t *testing.T) { |
| 467 | tests := []struct { |
nothing calls this directly
no test coverage detected