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

Function TestTransformHelperServer

http/codegen/transform_helper_test.go:14–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12)
13
14func TestTransformHelperServer(t *testing.T) {
15 cases := []struct {
16 Name string
17 DSL func()
18 Offset int
19 }{
20 // {"body-user-inner-default-1", testdata.PayloadBodyUserInnerDefaultDSL1, 1},
21 // {"body-user-recursive-default-1", testdata.PayloadBodyInlineRecursiveUserDSL1, 1},
22 }
23 for _, c := range cases {
24 t.Run(c.Name, func(t *testing.T) {
25 root := RunHTTPDSL(t, c.DSL)
26 services := CreateHTTPServices(root)
27 f := ServerEncodeDecodeFile("", root.API.HTTP.Services[0], services)
28 sections := f.SectionTemplates
29 require.Greater(t, len(sections), c.Offset)
30 code := codegen.SectionCode(t, sections[len(sections)-c.Offset])
31 testutil.AssertGo(t, "testdata/golden/transform_helper_"+c.Name+".go.golden", code)
32 })
33 }
34}
35
36func TestTransformHelperCLI(t *testing.T) {
37 cases := []struct {

Callers

nothing calls this directly

Calls 6

SectionCodeFunction · 0.92
AssertGoFunction · 0.92
RunHTTPDSLFunction · 0.85
CreateHTTPServicesFunction · 0.85
ServerEncodeDecodeFileFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected