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