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

Function TestCallNil

common/ast/expr_test.go:165–184  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

163}
164
165func TestCallNil(t *testing.T) {
166 expr := nilTestExpr(t)
167 call := expr.AsCall()
168 if call.FunctionName() != "" {
169 t.Errorf("FunctionName() got %s, wanted empty value", call.FunctionName())
170 }
171 if len(call.Args()) != 0 {
172 t.Errorf("Args() got %v, wanted zero", call.Args())
173 }
174 if call.IsMemberFunction() {
175 t.Error("IsMemberFunction() got true, wanted false")
176 }
177 if call.Target().ID() != 0 {
178 t.Errorf("empty Target() got %d, wanted 0", call.Target().ID())
179 }
180 expr.RenumberIDs(testIDGen(100))
181 if expr.ID() != 101 {
182 t.Errorf("RenumberIDs() got %d, wanted 101", expr.ID())
183 }
184}
185
186func TestComprehension(t *testing.T) {
187 fac := ast.NewExprFactory()

Callers

nothing calls this directly

Calls 10

nilTestExprFunction · 0.85
testIDGenFunction · 0.85
AsCallMethod · 0.65
FunctionNameMethod · 0.65
ArgsMethod · 0.65
IsMemberFunctionMethod · 0.65
IDMethod · 0.65
TargetMethod · 0.65
RenumberIDsMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected