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

Function TestStructNil

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

Source from the content-addressed store, hash-verified

448}
449
450func TestStructNil(t *testing.T) {
451 expr := nilTestExpr(t)
452 s := expr.AsStruct()
453 if s.TypeName() != "" {
454 t.Errorf("nil struct.TypeName() got %s, wanted ''", s.TypeName())
455 }
456 if len(s.Fields()) != 0 {
457 t.Errorf("nil struct.Fields() got %d, wanted 0", s.Fields())
458 }
459}
460
461func TestStructFieldNil(t *testing.T) {
462 fac := ast.NewExprFactory()

Callers

nothing calls this directly

Calls 4

nilTestExprFunction · 0.85
AsStructMethod · 0.65
TypeNameMethod · 0.65
FieldsMethod · 0.65

Tested by

no test coverage detected