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

Function TestServiceExprValidate

expr/service_test.go:92–107  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

90}
91
92func TestServiceExprValidate(t *testing.T) {
93 cases := []struct {
94 Name string
95 DSL func()
96 Error string
97 }{
98 {"service errors", testdata.ServiceErrorDSL, `attribute: error name "a" must be required in type "ServiceError"`},
99 }
100
101 for _, tc := range cases {
102 t.Run(tc.Name, func(t *testing.T) {
103 err := expr.RunInvalidDSL(t, tc.DSL)
104 assert.EqualError(t, err, tc.Error)
105 })
106 }
107}
108
109func TestErrorExprValidate(t *testing.T) {
110 cases := []struct {

Callers

nothing calls this directly

Calls 2

RunInvalidDSLFunction · 0.92
RunMethod · 0.45

Tested by

no test coverage detected