(t *testing.T)
| 279 | } |
| 280 | |
| 281 | func TestValidate_MissingDependencies(t *testing.T) { |
| 282 | tasks := []*model.Task{ |
| 283 | { |
| 284 | ID: "001", |
| 285 | Title: "Task 1", |
| 286 | Dependencies: []string{"002", "999"}, // 999 doesn't exist |
| 287 | }, |
| 288 | { |
| 289 | ID: "002", |
| 290 | Title: "Task 2", |
| 291 | }, |
| 292 | } |
| 293 | |
| 294 | v := NewValidator(false) |
| 295 | result := v.Validate(tasks) |
| 296 | |
| 297 | if result.Errors != 1 { |
| 298 | t.Errorf("Expected 1 error for missing dependency, got %d", result.Errors) |
| 299 | } |
| 300 | |
| 301 | // Check that the error mentions the missing task ID |
| 302 | foundMissingDep := false |
| 303 | for _, issue := range result.Issues { |
| 304 | if issue.TaskID == "001" && issue.Level == LevelError { |
| 305 | foundMissingDep = true |
| 306 | } |
| 307 | } |
| 308 | |
| 309 | if !foundMissingDep { |
| 310 | t.Error("Expected missing dependency error for task 001") |
| 311 | } |
| 312 | } |
| 313 | |
| 314 | func TestValidate_CircularDependencies(t *testing.T) { |
| 315 | tests := []struct { |
nothing calls this directly
no test coverage detected