renderClientCLISectionCode renders the requested client CLI section for a DSL and returns the generated code.
(t *testing.T, dsl func(), fileIndex, sectionIndex int)
| 63 | // renderClientCLISectionCode renders the requested client CLI section for a |
| 64 | // DSL and returns the generated code. |
| 65 | func renderClientCLISectionCode(t *testing.T, dsl func(), fileIndex, sectionIndex int) string { |
| 66 | t.Helper() |
| 67 | |
| 68 | root := RunHTTPDSL(t, dsl) |
| 69 | services := CreateHTTPServices(root) |
| 70 | fs := ClientCLIFiles("", services) |
| 71 | |
| 72 | return codegen.SectionCode(t, fs[fileIndex].SectionTemplates[sectionIndex]) |
| 73 | } |
| 74 | |
| 75 | // renderClientTypesCode renders the client type file for a single-service DSL. |
| 76 | func renderClientTypesCode(t *testing.T, dsl func()) string { |
no test coverage detected