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

Function TestOverloadFunctionLateBinding

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

Source from the content-addressed store, hash-verified

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