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

Function TestComprehensionNil

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

Source from the content-addressed store, hash-verified

239}
240
241func TestComprehensionNil(t *testing.T) {
242 expr := nilTestExpr(t)
243 comp := expr.AsComprehension()
244 if comp.IterRange().Kind() != ast.UnspecifiedExprKind {
245 t.Errorf("IterRange() got %v, wanted unspecified", comp.IterRange().Kind())
246 }
247 if comp.AccuInit().Kind() != ast.UnspecifiedExprKind {
248 t.Errorf("AccuInit() got %v, wanted unspecified", comp.AccuInit().Kind())
249 }
250 if comp.LoopCondition().Kind() != ast.UnspecifiedExprKind {
251 t.Errorf("LoopCondition() got %v, wanted unspecified", comp.LoopCondition().Kind())
252 }
253 if comp.LoopStep().Kind() != ast.UnspecifiedExprKind {
254 t.Errorf("LoopStep() got %v, wanted unspecified", comp.LoopStep().Kind())
255 }
256 if comp.Result().Kind() != ast.UnspecifiedExprKind {
257 t.Errorf("Result() got %v, wanted unspecified", comp.Result().Kind())
258 }
259 expr.RenumberIDs(testIDGen(100))
260 if expr.ID() != 101 {
261 t.Errorf("RenumberIDs() got %d, wanted 101", expr.ID())
262 }
263}
264
265func TestIdent(t *testing.T) {
266 fac := ast.NewExprFactory()

Callers

nothing calls this directly

Calls 11

nilTestExprFunction · 0.85
testIDGenFunction · 0.85
AsComprehensionMethod · 0.65
KindMethod · 0.65
IterRangeMethod · 0.65
AccuInitMethod · 0.65
LoopConditionMethod · 0.65
LoopStepMethod · 0.65
ResultMethod · 0.65
RenumberIDsMethod · 0.65
IDMethod · 0.65

Tested by

no test coverage detected