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

Function TestEncode

http/codegen/server_encode_test.go:13–103  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestEncode(t *testing.T) {
14 cases := []struct {
15 Name string
16 DSL func()
17 }{
18 {"header-bool", testdata.ResultHeaderBoolDSL},
19 {"header-int", testdata.ResultHeaderIntDSL},
20 {"header-int32", testdata.ResultHeaderInt32DSL},
21 {"header-int64", testdata.ResultHeaderInt64DSL},
22 {"header-uint", testdata.ResultHeaderUIntDSL},
23 {"header-uint32", testdata.ResultHeaderUInt32DSL},
24 {"header-uint64", testdata.ResultHeaderUInt64DSL},
25 {"header-float32", testdata.ResultHeaderFloat32DSL},
26 {"header-float64", testdata.ResultHeaderFloat64DSL},
27 {"header-string", testdata.ResultHeaderStringDSL},
28 {"header-bytes", testdata.ResultHeaderBytesDSL},
29 {"header-any", testdata.ResultHeaderAnyDSL},
30 {"header-array-bool", testdata.ResultHeaderArrayBoolDSL},
31 {"header-array-int", testdata.ResultHeaderArrayIntDSL},
32 {"header-array-int32", testdata.ResultHeaderArrayInt32DSL},
33 {"header-array-int64", testdata.ResultHeaderArrayInt64DSL},
34 {"header-array-uint", testdata.ResultHeaderArrayUIntDSL},
35 {"header-array-uint32", testdata.ResultHeaderArrayUInt32DSL},
36 {"header-array-uint64", testdata.ResultHeaderArrayUInt64DSL},
37 {"header-array-float32", testdata.ResultHeaderArrayFloat32DSL},
38 {"header-array-float64", testdata.ResultHeaderArrayFloat64DSL},
39 {"header-array-string", testdata.ResultHeaderArrayStringDSL},
40 {"header-array-bytes", testdata.ResultHeaderArrayBytesDSL},
41 {"header-array-any", testdata.ResultHeaderArrayAnyDSL},
42
43 {"header-bool-default", testdata.ResultHeaderBoolDefaultDSL},
44 {"header-bool-required-default", testdata.ResultHeaderBoolRequiredDefaultDSL},
45 {"header-string-default", testdata.ResultHeaderStringDefaultDSL},
46 {"header-string-required-default", testdata.ResultHeaderStringRequiredDefaultDSL},
47 {"header-array-bool-default", testdata.ResultHeaderArrayBoolDefaultDSL},
48 {"header-array-bool-required-default", testdata.ResultHeaderArrayBoolRequiredDefaultDSL},
49 {"header-array-string-default", testdata.ResultHeaderArrayStringDefaultDSL},
50 {"header-array-string-required-default", testdata.ResultHeaderArrayStringRequiredDefaultDSL},
51
52 {"body-string", testdata.ResultBodyStringDSL},
53 {"body-object", testdata.ResultBodyObjectDSL},
54 {"body-user", testdata.ResultBodyUserDSL},
55 {"body-union", testdata.ResultBodyUnionDSL},
56 {"body-result-multiple-views", testdata.ResultBodyMultipleViewsDSL},
57 {"body-result-collection-multiple-views", testdata.ResultBodyCollectionDSL},
58 {"body-result-collection-explicit-view", testdata.ResultBodyCollectionExplicitViewDSL},
59 {"empty-body-result-multiple-views", testdata.EmptyBodyResultMultipleViewsDSL},
60 {"body-array-string", testdata.ResultBodyArrayStringDSL},
61 {"body-array-user", testdata.ResultBodyArrayUserDSL},
62 {"body-primitive-string", testdata.ResultBodyPrimitiveStringDSL},
63 {"body-primitive-bool", testdata.ResultBodyPrimitiveBoolDSL},
64 {"body-primitive-any", testdata.ResultBodyPrimitiveAnyDSL},
65 {"body-primitive-array-string", testdata.ResultBodyPrimitiveArrayStringDSL},
66 {"body-primitive-array-bool", testdata.ResultBodyPrimitiveArrayBoolDSL},
67 {"body-primitive-array-user", testdata.ResultBodyPrimitiveArrayUserDSL},
68 {"body-inline-object", testdata.ResultBodyInlineObjectDSL},
69
70 {"body-header-object", testdata.ResultBodyHeaderObjectDSL},

Callers

nothing calls this directly

Calls 6

SectionCodeFunction · 0.92
AssertGoFunction · 0.92
RunHTTPDSLFunction · 0.85
CreateHTTPServicesFunction · 0.85
ServerFilesFunction · 0.70
RunMethod · 0.45

Tested by

no test coverage detected