(t *testing.T)
| 398 | } |
| 399 | |
| 400 | func TestValidatorConfig(t *testing.T) { |
| 401 | config := newValidatorConfig() |
| 402 | result := config.GetOrDefault("ext.validate.custom", 2) |
| 403 | if result != 2 { |
| 404 | t.Errorf("config.GetOrDefault() got %v, wanted default of 2", result) |
| 405 | } |
| 406 | result = config.GetOrDefault(HomogeneousAggregateLiteralExemptFunctions, []string{}) |
| 407 | if reflect.TypeOf(result) != reflect.TypeOf([]string{}) { |
| 408 | t.Errorf("config.GetOrDefault() got %T, wanted type %T", result, []string{}) |
| 409 | } |
| 410 | err := config.Set(HomogeneousAggregateLiteralExemptFunctions, []string{"_==_"}) |
| 411 | if err != nil { |
| 412 | t.Errorf("config.Set() failed: %v", err) |
| 413 | } |
| 414 | err = config.Set(HomogeneousAggregateLiteralExemptFunctions, map[string]any{}) |
| 415 | if err == nil { |
| 416 | t.Error("config.Set() with incorrect value type did not fail") |
| 417 | } |
| 418 | } |
nothing calls this directly
no test coverage detected