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

Function TestOverloadFunctionLateBinding

common/decls/decls_test.go:762–775  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

760}
761
762func TestOverloadFunctionLateBinding(t *testing.T) {
763 function, err := NewFunction("id",
764 Overload("id_bool", []*types.Type{types.BoolType}, types.AnyType, LateFunctionBinding(), LateFunctionBinding()),
765 )
766 if err != nil {
767 t.Fatalf("NewFunction() failed: %v", err)
768 }
769 if len(function.OverloadDecls()) != 1 {
770 t.Fatalf("NewFunction() got %v, wanted 1 overload", function.OverloadDecls())
771 }
772 if !function.OverloadDecls()[0].HasLateBinding() {
773 t.Errorf("overload %v did not have a late binding", function.OverloadDecls()[0])
774 }
775}
776
777func TestOverloadFunctionMixLateAndNonLateBinding(t *testing.T) {
778 _, err := NewFunction("id",

Callers

nothing calls this directly

Calls 5

OverloadDeclsMethod · 0.80
NewFunctionFunction · 0.70
OverloadFunction · 0.70
LateFunctionBindingFunction · 0.70
HasLateBindingMethod · 0.45

Tested by

no test coverage detected