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

Function TestOneOfCustomKeysSameKeyError

dsl/oneof_test.go:107–128  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

105}
106
107func TestOneOfCustomKeysSameKeyError(t *testing.T) {
108 eval.Context = &eval.DSLContext{}
109
110 ut := &expr.UserTypeExpr{
111 AttributeExpr: &expr.AttributeExpr{
112 Type: &expr.Object{},
113 },
114 TypeName: "TestType",
115 }
116
117 eval.Execute(func() {
118 OneOf("Shape", func() {
119 Meta("oneof:type:field", "same")
120 Meta("oneof:value:field", "same")
121 Attribute("Circle", Int)
122 })
123 }, ut)
124
125 if eval.Context.Errors == nil {
126 t.Fatal("expected DSL error for same type and value keys, got none")
127 }
128}

Callers

nothing calls this directly

Calls 4

ExecuteFunction · 0.92
OneOfFunction · 0.85
MetaFunction · 0.85
AttributeFunction · 0.85

Tested by

no test coverage detected