(t *testing.T)
| 851 | } |
| 852 | |
| 853 | func 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 | |
| 874 | func TestValidateConfig_NilConfig(t *testing.T) { |
| 875 | v := NewValidator(false) |
nothing calls this directly
no test coverage detected