(t *testing.T)
| 471 | } |
| 472 | |
| 473 | func TestValidatorConfig(t *testing.T) { |
| 474 | config := newValidatorConfig() |
| 475 | result := config.GetOrDefault("ext.validate.custom", 2) |
| 476 | if result != 2 { |
| 477 | t.Errorf("config.GetOrDefault() got %v, wanted default of 2", result) |
| 478 | } |
| 479 | result = config.GetOrDefault(HomogeneousAggregateLiteralExemptFunctions, []string{}) |
| 480 | if reflect.TypeOf(result) != reflect.TypeOf([]string{}) { |
| 481 | t.Errorf("config.GetOrDefault() got %T, wanted type %T", result, []string{}) |
| 482 | } |
| 483 | err := config.Set(HomogeneousAggregateLiteralExemptFunctions, []string{"_==_"}) |
| 484 | if err != nil { |
| 485 | t.Errorf("config.Set() failed: %v", err) |
| 486 | } |
| 487 | err = config.Set(HomogeneousAggregateLiteralExemptFunctions, map[string]any{}) |
| 488 | if err == nil { |
| 489 | t.Error("config.Set() with incorrect value type did not fail") |
| 490 | } |
| 491 | } |
| 492 | |
| 493 | func TestOverrideValidator(t *testing.T) { |
| 494 | // Base environment configured with comprehension nesting limit of 2. |
nothing calls this directly
no test coverage detected