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

Function TestMapNil

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

Source from the content-addressed store, hash-verified

355}
356
357func TestMapNil(t *testing.T) {
358 expr := nilTestExpr(t)
359 m := expr.AsMap()
360 if m.Size() != 0 {
361 t.Errorf("nil map.Size() got %d, wanted 0", m.Size())
362 }
363 if len(m.Entries()) != 0 {
364 t.Errorf("nil map.Entries() got %d, wanted 0", m.Entries())
365 }
366}
367
368func TestMapEntryNil(t *testing.T) {
369 fac := ast.NewExprFactory()

Callers

nothing calls this directly

Calls 4

nilTestExprFunction · 0.85
AsMapMethod · 0.65
SizeMethod · 0.65
EntriesMethod · 0.65

Tested by

no test coverage detected