MCPcopy Create free account
hub / github.com/driangle/taskmd / TestValidate_MissingDependencies

Function TestValidate_MissingDependencies

sdk/go/validator/validator_test.go:281–312  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

279}
280
281func 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
314func TestValidate_CircularDependencies(t *testing.T) {
315 tests := []struct {

Callers

nothing calls this directly

Calls 3

ValidateMethod · 0.95
NewValidatorFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected