(t *testing.T)
| 74 | } |
| 75 | |
| 76 | func TestResponseDecoder(t *testing.T) { |
| 77 | cases := []struct { |
| 78 | Name string |
| 79 | DSL func() |
| 80 | }{ |
| 81 | {"response-decoder-result-with-views", testdata.MessageResultTypeWithViewsDSL}, |
| 82 | {"response-decoder-result-with-explicit-view", testdata.MessageResultTypeWithExplicitViewDSL}, |
| 83 | {"response-decoder-result-array", testdata.MessageArrayDSL}, |
| 84 | {"response-decoder-result-primitive", testdata.UnaryRPCNoPayloadDSL}, |
| 85 | {"response-decoder-result-with-metadata", testdata.MessageWithMetadataDSL}, |
| 86 | {"response-decoder-result-with-validate", testdata.MessageWithValidateDSL}, |
| 87 | {"response-decoder-result-collection", testdata.MessageResultTypeCollectionDSL}, |
| 88 | {"response-decoder-server-streaming", testdata.ServerStreamingUserTypeDSL}, |
| 89 | {"response-decoder-server-streaming-result-with-views", testdata.ServerStreamingResultWithViewsDSL}, |
| 90 | {"response-decoder-client-streaming", testdata.ClientStreamingRPCDSL}, |
| 91 | {"response-decoder-bidirectional-streaming", testdata.BidirectionalStreamingRPCDSL}, |
| 92 | } |
| 93 | for _, c := range cases { |
| 94 | t.Run(c.Name, func(t *testing.T) { |
| 95 | root := RunGRPCDSL(t, c.DSL) |
| 96 | services := CreateGRPCServices(root) |
| 97 | fs := ClientFiles("", services) |
| 98 | require.Len(t, fs, 2) |
| 99 | sections := fs[1].Section("response-decoder") |
| 100 | require.NotEmpty(t, sections) |
| 101 | code := codegen.SectionsCode(t, sections) |
| 102 | testutil.AssertGo(t, "testdata/golden/response_decoder_"+c.Name+".go.golden", code) |
| 103 | }) |
| 104 | } |
| 105 | } |
nothing calls this directly
no test coverage detected