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