(t *testing.T)
| 132 | } |
| 133 | |
| 134 | func TestLoad_DuplicateRoutingRuleName(t *testing.T) { |
| 135 | cfgPath := writeTempConfig(t, ` |
| 136 | backends: |
| 137 | - name: b1 |
| 138 | type: mock |
| 139 | timeout_ms: 100 |
| 140 | cost: { unit: 1, currency: credit } |
| 141 | tenants: |
| 142 | - id: t1 |
| 143 | routing: |
| 144 | default_backend: b1 |
| 145 | rules: |
| 146 | - name: same-rule |
| 147 | use_backend: b1 |
| 148 | - name: same-rule |
| 149 | use_backend: b1 |
| 150 | reliability: |
| 151 | fallback_enabled: false |
| 152 | `) |
| 153 | |
| 154 | _, err := Load(cfgPath) |
| 155 | if err == nil || !strings.Contains(err.Error(), "duplicate routing rule name") { |
| 156 | t.Fatalf("expected duplicate routing rule name validation error, got: %v", err) |
| 157 | } |
| 158 | } |
| 159 | |
| 160 | func TestLoad_FallbackRuleRequiresTrigger(t *testing.T) { |
| 161 | cfgPath := writeTempConfig(t, ` |
nothing calls this directly
no test coverage detected