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

Function TestFunctionDisableDeclaration

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

Source from the content-addressed store, hash-verified

949}
950
951func TestFunctionDisableDeclaration(t *testing.T) {
952 fn, err := NewFunction("in",
953 DisableDeclaration(true),
954 Overload("in_list",
955 []*types.Type{types.NewListType(types.NewTypeParamType("K")), types.NewTypeParamType("K")},
956 types.BoolType,
957 ),
958 )
959 if err != nil {
960 t.Fatalf("NewFunction() failed: %v", err)
961 }
962 if !fn.IsDeclarationDisabled() {
963 t.Error("got declaration enabled, wanted disabled")
964 }
965}
966
967func TestFunctionEnableDeclaration(t *testing.T) {
968 fn, err := NewFunction("in",

Callers

nothing calls this directly

Calls 7

NewListTypeFunction · 0.92
NewTypeParamTypeFunction · 0.92
IsDeclarationDisabledMethod · 0.80
NewFunctionFunction · 0.70
DisableDeclarationFunction · 0.70
OverloadFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected