You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: eval/eval_test.go
+69-23Lines changed: 69 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -9,30 +9,76 @@ import (
9
9
"goa.design/goa/v3/expr"
10
10
)
11
11
12
-
funcTestTooManyArgError(t*testing.T) {
13
-
cases:=map[string]struct {
14
-
DSLfunc()
15
-
Errorstring
12
+
funcTestInvalidArgError(t*testing.T) {
13
+
dsls:=map[string]struct {
14
+
dslfunc()
15
+
wantstring
16
16
}{
17
-
"ArrayOf": {func() { ArrayOf(String, func() {}, func() {}) }, "too many arguments given to ArrayOf"},
18
-
"Attribute": {func() { Type("name", func() { Attribute("name", 1, 2, 3, 4) }) }, "too many arguments given to Attribute"},
19
-
"Example": {func() { Example(1, 2, 3) }, "too many arguments given to Example"},
20
-
"Files": {func() { Files("path", "filename", func() {}, func() {}) }, "too many arguments given to Files"},
21
-
"MapOf": {func() { MapOf(String, String, func() {}, func() {}) }, "too many arguments given to MapOf"},
22
-
"MapParams": {func() { MapParams(1, 2) }, "too many arguments given to MapParams"},
23
-
"Payload": {func() { Payload(String, 1, 2, 3) }, "too many arguments given to Payload"},
24
-
"Response": {func() { API("name", func() { HTTP(func() { Response(StatusOK, "name", 1, 2) }) }) }, "too many arguments given to Response"},
25
-
"Result": {func() { Result(String, 1, 2, 3) }, "too many arguments given to Result"},
26
-
"ResultType": {func() { ResultType("identifier", "name", func() {}, func() {}) }, "too many arguments given to ResultType"},
27
-
"Scope": {func() { BasicAuthSecurity("name", func() { Scope("name", "1", "2") }) }, "too many arguments given to Scope"},
28
-
"Server": {func() { Server("name", func() {}, func() {}) }, "too many arguments given to Server"},
29
-
"StreamingPayload": {func() { StreamingPayload(String, 1, 2, 3) }, "too many arguments given to StreamingPayload"},
30
-
"StreamingResult": {func() { StreamingResult(String, 1, 2, 3) }, "too many arguments given to StreamingResult"},
31
-
"Type": {func() { Type("name", 1, 2, 3) }, "too many arguments given to Type"},
17
+
"Attribute": {func() { Type("name", func() { Attribute("name", String, "description", 1) }) }, "cannot use 1 (type int) as type func()"},
18
+
"Body": {func() { Service("s", func() { Method("m", func() { HTTP(func() { Body(1) }) }) }) }, "cannot use 1 (type int) as type attribute name, user type or DSL"},
19
+
"ErrorName (bool)": {func() { Type("name", func() { ErrorName(true) }) }, "cannot use true (type bool) as type name or position"},
20
+
"ErrorName (int)": {func() { Type("name", func() { ErrorName(1, 2) }) }, "cannot use 2 (type int) as type name"},
21
+
"Example": {func() { Example(1, 2) }, "cannot use 1 (type int) as type summary (string)"},
22
+
"Headers": {func() { Headers(1) }, "cannot use 1 (type int) as type function"},
23
+
"Param": {func() { API("name", func() { HTTP(func() { Params(1) }) }) }, "cannot use 1 (type int) as type function"},
24
+
"Response": {func() { Service("s", func() { HTTP(func() { Response(1) }) }) }, "cannot use 1 (type int) as type name of error"},
25
+
"ResultType": {func() { ResultType("identifier", 1) }, "cannot use 1 (type int) as type function or string"},
26
+
"Security": {func() { Security(1) }, "cannot use 1 (type int) as type security scheme or security scheme name"},
27
+
"Type": {func() { Type("name", 1) }, "cannot use 1 (type int) as type type or function"},
0 commit comments