MCPcopy Create free account
hub / github.com/goadesign/goa / TestAttributeExprIsPrimitivePointer

Function TestAttributeExprIsPrimitivePointer

expr/attribute_test.go:658–821  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

656}
657
658func TestAttributeExprIsPrimitivePointer(t *testing.T) {
659 var (
660 attributeBoolean = AttributeExpr{
661 Type: Boolean,
662 }
663 attributeObject = AttributeExpr{
664 Type: &Object{
665 &NamedAttributeExpr{
666 Name: "foo",
667 Attribute: &AttributeExpr{
668 Type: String,
669 },
670 },
671 &NamedAttributeExpr{
672 Name: "bar",
673 Attribute: &AttributeExpr{
674 Type: &Array{
675 ElemType: &AttributeExpr{
676 Type: String,
677 },
678 },
679 },
680 },
681 &NamedAttributeExpr{
682 Name: "baz",
683 Attribute: &AttributeExpr{
684 Type: Bytes,
685 },
686 },
687 &NamedAttributeExpr{
688 Name: "qux",
689 Attribute: &AttributeExpr{
690 Type: Any,
691 },
692 },
693 &NamedAttributeExpr{
694 Name: "quux",
695 Attribute: &AttributeExpr{
696 Type: String,
697 },
698 },
699 &NamedAttributeExpr{
700 Name: "corge",
701 Attribute: &AttributeExpr{
702 Type: String,
703 DefaultValue: "default",
704 },
705 },
706 },
707 Validation: &ValidationExpr{
708 Required: []string{"quux"},
709 },
710 }
711 )
712 cases := map[string]struct {
713 attribute AttributeExpr
714 attName string
715 useDefault bool

Callers

nothing calls this directly

Calls 1

IsPrimitivePointerMethod · 0.45

Tested by

no test coverage detected