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

Function TestValidateConfig_MissingPaths

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

Source from the content-addressed store, hash-verified

797}
798
799func 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
826func TestValidateConfig_EmptyPaths(t *testing.T) {
827 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