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

Function TestListNil

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

Source from the content-addressed store, hash-verified

304}
305
306func TestListNil(t *testing.T) {
307 expr := nilTestExpr(t)
308 list := expr.AsList()
309 if list.Size() != 0 {
310 t.Errorf("nil list.Size() got %d, wanted 0", list.Size())
311 }
312 if len(list.Elements()) != 0 {
313 t.Errorf("nil list.Elements() got %d, wanted 0", list.Elements())
314 }
315 if len(list.OptionalIndices()) != 0 {
316 t.Errorf("nil list.OptionalIndices() got %d, wanted 0", list.OptionalIndices())
317 }
318}
319
320func TestLiteralNil(t *testing.T) {
321 expr := nilTestExpr(t)

Callers

nothing calls this directly

Calls 5

nilTestExprFunction · 0.85
AsListMethod · 0.65
SizeMethod · 0.65
ElementsMethod · 0.65
OptionalIndicesMethod · 0.65

Tested by

no test coverage detected