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

Function TestTooFewArgError

eval/eval_test.go:54–71  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

52}
53
54func TestTooFewArgError(t *testing.T) {
55 dsls := map[string]func(){
56 "Body": func() { Body() },
57 "ErrorName": func() { ErrorName() },
58 "ErrorName (int)": func() { Type("name", func() { ErrorName(1) }) },
59 "Example": func() { Example() },
60 "OneOf": func() { OneOf("name") },
61 "Response (grpc)": func() { Service("s", func() { GRPC(func() { Response("name") }) }) },
62 "Response (http)": func() { Service("s", func() { HTTP(func() { Response("name") }) }) },
63 }
64 for name, dsl := range dsls {
65 t.Run(name, func(t *testing.T) {
66 err := expr.RunInvalidDSL(t, dsl)
67 assert.Len(t, strings.Split(err.Error(), "\n"), 1)
68 assert.Contains(t, err.Error(), "too few arguments given to "+strings.Split(name, " ")[0])
69 })
70 }
71}
72
73func TestTooManyArgError(t *testing.T) {
74 dsls := map[string]func(){

Callers

nothing calls this directly

Calls 12

RunInvalidDSLFunction · 0.92
BodyFunction · 0.85
ErrorNameFunction · 0.85
OneOfFunction · 0.85
GRPCFunction · 0.85
TypeFunction · 0.50
ExampleFunction · 0.50
ServiceFunction · 0.50
ResponseFunction · 0.50
HTTPFunction · 0.50
RunMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected