(t *testing.T)
| 1537 | } |
| 1538 | |
| 1539 | func TestValidatorConfigValue(t *testing.T) { |
| 1540 | var v *Validator |
| 1541 | if _, found := v.ConfigValue("limit"); found { |
| 1542 | t.Error("v.ConfigValue() got value from nil validator") |
| 1543 | } |
| 1544 | v = NewValidator("validator").SetConfig(map[string]any{"limit": 2}) |
| 1545 | if _, found := v.ConfigValue("absent"); found { |
| 1546 | t.Error("v.ConfigValue() found absent key") |
| 1547 | } |
| 1548 | if val, found := v.ConfigValue("limit"); !found || val != 2 { |
| 1549 | t.Errorf("v.ConfigValue() got %v, %t -- wanted 2, true", val, found) |
| 1550 | } |
| 1551 | } |
| 1552 | |
| 1553 | func TestFeatureValidate(t *testing.T) { |
| 1554 | tests := []struct { |
nothing calls this directly
no test coverage detected