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

Function TestFunctionDisableDeclaration

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

Source from the content-addressed store, hash-verified

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