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

Function TestTransformHelperCLI

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

Source from the content-addressed store, hash-verified

34}
35
36func TestTransformHelperCLI(t *testing.T) {
37 cases := []struct {
38 Name string
39 DSL func()
40 Offset int
41 }{
42 // {"cli-body-user-inner-default-1", testdata.PayloadBodyUserInnerDefaultDSLCLI1, 1},
43 // {"cli-body-user-inner-default-2", testdata.PayloadBodyUserInnerDefaultDSLCLI2, 2},
44 // {"cli-body-user-recursive-default-1", testdata.PayloadBodyInlineRecursiveUserDSLCLI1, 1},
45 // {"cli-body-user-recursive-default-2", testdata.PayloadBodyInlineRecursiveUserDSLCLI2, 2},
46 }
47 for _, c := range cases {
48 t.Run(c.Name, func(t *testing.T) {
49 root := RunHTTPDSL(t, c.DSL)
50 services := CreateHTTPServices(root)
51 f := ClientEncodeDecodeFile("", root.API.HTTP.Services[0], services)
52 sections := f.SectionTemplates
53 require.Greater(t, len(sections), c.Offset)
54 code := codegen.SectionCode(t, sections[len(sections)-c.Offset])
55 testutil.AssertGo(t, "testdata/golden/transform_helper_"+c.Name+".go.golden", code)
56 })
57 }
58}

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected