MCPcopy Create free account
hub / github.com/cel-expr/cel-go / TestValidateOverloadModels

Function TestValidateOverloadModels

common/cost/validate_test.go:242–253  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

240}
241
242func 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.

Callers

nothing calls this directly

Calls 6

ValidateOverloadModelsFunction · 0.85
EvalCostFunction · 0.85
ConstFunction · 0.85
OverloadFunction · 0.70
ContainsMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected