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

Function RunDSL

expr/testing.go:14–26  ·  view source on GitHub ↗

RunDSL returns the DSL root resulting from running the given DSL. Used only in tests.

(t *testing.T, dsl func())

Source from the content-addressed store, hash-verified

12// RunDSL returns the DSL root resulting from running the given DSL.
13// Used only in tests.
14func RunDSL(t *testing.T, dsl func()) *RootExpr {
15 t.Helper()
16 ResetDSL(t)
17
18 // run DSL (first pass)
19 require.True(t, eval.Execute(dsl, nil), eval.Context.Error())
20
21 // run DSL (second pass)
22 require.NoError(t, eval.RunDSL())
23
24 // return generated root
25 return Root
26}
27
28// RunInvalidDSL returns the error resulting from running the given DSL.
29// It is used only in tests.

Calls 4

ExecuteFunction · 0.92
RunDSLFunction · 0.92
ResetDSLFunction · 0.85
ErrorMethod · 0.45