(t *testing.T)
| 240 | } |
| 241 | |
| 242 | func TestValidate_DuplicateIDs(t *testing.T) { |
| 243 | tasks := []*model.Task{ |
| 244 | { |
| 245 | ID: "001", |
| 246 | Title: "Task 1", |
| 247 | FilePath: "/path/to/task1.md", |
| 248 | }, |
| 249 | { |
| 250 | ID: "001", |
| 251 | Title: "Task 2", |
| 252 | FilePath: "/path/to/task2.md", |
| 253 | }, |
| 254 | { |
| 255 | ID: "002", |
| 256 | Title: "Task 3", |
| 257 | FilePath: "/path/to/task3.md", |
| 258 | }, |
| 259 | } |
| 260 | |
| 261 | v := NewValidator(false) |
| 262 | result := v.Validate(tasks) |
| 263 | |
| 264 | if result.Errors != 1 { |
| 265 | t.Errorf("Expected 1 error for duplicate IDs, got %d", result.Errors) |
| 266 | } |
| 267 | |
| 268 | // Check that the error message mentions both files |
| 269 | foundDuplicateError := false |
| 270 | for _, issue := range result.Issues { |
| 271 | if issue.TaskID == "001" && issue.Level == LevelError { |
| 272 | foundDuplicateError = true |
| 273 | } |
| 274 | } |
| 275 | |
| 276 | if !foundDuplicateError { |
| 277 | t.Error("Expected duplicate ID error for task 001") |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | func TestValidate_MissingDependencies(t *testing.T) { |
| 282 | tasks := []*model.Task{ |
nothing calls this directly
no test coverage detected