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

Function TestValidateConfig_EmptyPaths

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

Source from the content-addressed store, hash-verified

824}
825
826func TestValidateConfig_EmptyPaths(t *testing.T) {
827 v := NewValidator(false)
828 config := &ConfigData{
829 Scopes: map[string]ScopeConfig{
830 "cli/graph": {Paths: []string{}}, // empty array
831 },
832 TopKeys: []string{"scopes"},
833 ConfigPath: ".taskmd.yaml",
834 }
835
836 result := v.ValidateConfig(config)
837
838 if result.Errors != 1 {
839 t.Errorf("Expected 1 error for empty paths, got %d", result.Errors)
840 }
841
842 found := false
843 for _, issue := range result.Issues {
844 if issue.Level == LevelError && issue.Message == "scope 'cli/graph' has empty paths array" {
845 found = true
846 }
847 }
848 if !found {
849 t.Error("Expected empty paths error for scope cli/graph")
850 }
851}
852
853func TestValidateConfig_UnknownKeys(t *testing.T) {
854 v := NewValidator(false)

Callers

nothing calls this directly

Calls 3

ValidateConfigMethod · 0.95
NewValidatorFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected