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

Function TestValidateConfig_UnknownKeys

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

Source from the content-addressed store, hash-verified

851}
852
853func TestValidateConfig_UnknownKeys(t *testing.T) {
854 v := NewValidator(false)
855 config := &ConfigData{
856 Scopes: map[string]ScopeConfig{},
857 TopKeys: []string{"scopes", "dir", "banana", "foobar"},
858 ConfigPath: ".taskmd.yaml",
859 }
860
861 result := v.ValidateConfig(config)
862
863 if result.Warnings != 2 {
864 t.Errorf("Expected 2 warnings for unknown keys, got %d", result.Warnings)
865 for _, issue := range result.Issues {
866 t.Logf(" Issue: [%s] %s", issue.Level, issue.Message)
867 }
868 }
869 if result.Errors != 0 {
870 t.Errorf("Expected no errors, got %d", result.Errors)
871 }
872}
873
874func TestValidateConfig_NilConfig(t *testing.T) {
875 v := NewValidator(false)

Callers

nothing calls this directly

Calls 2

ValidateConfigMethod · 0.95
NewValidatorFunction · 0.85

Tested by

no test coverage detected