(t *testing.T)
| 797 | } |
| 798 | |
| 799 | func TestValidateConfig_MissingPaths(t *testing.T) { |
| 800 | v := NewValidator(false) |
| 801 | config := &ConfigData{ |
| 802 | Scopes: map[string]ScopeConfig{ |
| 803 | "cli/graph": {Paths: nil}, // missing paths field |
| 804 | }, |
| 805 | TopKeys: []string{"scopes"}, |
| 806 | ConfigPath: ".taskmd.yaml", |
| 807 | } |
| 808 | |
| 809 | result := v.ValidateConfig(config) |
| 810 | |
| 811 | if result.Errors != 1 { |
| 812 | t.Errorf("Expected 1 error for missing paths, got %d", result.Errors) |
| 813 | } |
| 814 | |
| 815 | found := false |
| 816 | for _, issue := range result.Issues { |
| 817 | if issue.Level == LevelError && issue.Message == "scope 'cli/graph' is missing required field: paths" { |
| 818 | found = true |
| 819 | } |
| 820 | } |
| 821 | if !found { |
| 822 | t.Error("Expected missing paths error for scope cli/graph") |
| 823 | } |
| 824 | } |
| 825 | |
| 826 | func TestValidateConfig_EmptyPaths(t *testing.T) { |
| 827 | v := NewValidator(false) |
nothing calls this directly
no test coverage detected