From 98f954b919a5341f730fc6ca7d72b5b8db05b9ce Mon Sep 17 00:00:00 2001 From: Ichinose Shogo Date: Mon, 21 Feb 2022 21:59:51 +0900 Subject: [PATCH] add test for #161 --- _integration_tests/integration_test.go | 10 +++++++++ _integration_tests/issue161/design/design.go | 23 ++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 _integration_tests/issue161/design/design.go diff --git a/_integration_tests/integration_test.go b/_integration_tests/integration_test.go index c461d343..c58ecd7b 100644 --- a/_integration_tests/integration_test.go +++ b/_integration_tests/integration_test.go @@ -120,6 +120,16 @@ type Multimedialist struct { } } +func TestIssue161(t *testing.T) { + defer cleanup("./issue161/*") + if err := goagen("./issue161", "bootstrap", "-d", "github.com/shogo82148/goa-v1/_integration_tests/issue161/design"); err != nil { + t.Error(err.Error()) + } + if err := gobuild("./issue161"); err != nil { + t.Error(err.Error()) + } +} + func goagen(dir, command string, args ...string) error { pkg, err := build.Import("github.com/shogo82148/goa-v1/goagen", "", 0) if err != nil { diff --git a/_integration_tests/issue161/design/design.go b/_integration_tests/issue161/design/design.go new file mode 100644 index 00000000..464b2e93 --- /dev/null +++ b/_integration_tests/issue161/design/design.go @@ -0,0 +1,23 @@ +package design + +import ( + . "github.com/shogo82148/goa-v1/design" + . "github.com/shogo82148/goa-v1/design/apidsl" +) + +var _ = API("media", func() { + Title("An API exercising the DefaultMedia definition") + Host("localhost:8080") + Scheme("http") +}) + +var Author = Type("Author", func() { + Attribute("name", String) + Attribute("country", String) + Required("name") +}) + +var Book = Type("Book", func() { + Attribute("title", String) + Attribute("author", Author) +})