| 240 | } |
| 241 | |
| 242 | func TestValidateOverloadModels(t *testing.T) { |
| 243 | err := ValidateOverloadModels( |
| 244 | Overload("first", EvalCost(Const(1))), |
| 245 | Overload("second", EvalCost(unanswerable)), |
| 246 | ) |
| 247 | if err == nil || !strings.Contains(err.Error(), `overload "second"`) { |
| 248 | t.Errorf("ValidateOverloadModels() errored: %v, wanted the second model reported", err) |
| 249 | } |
| 250 | if err := ValidateOverloadModels(); err != nil { |
| 251 | t.Errorf("ValidateOverloadModels() errored: %v, wanted nil", err) |
| 252 | } |
| 253 | } |
| 254 | |
| 255 | // TestStandardOverloadModelsValidate holds the shipped models to the same rules user models are |
| 256 | // held to at registration. |