(t *testing.T)
| 150 | } |
| 151 | |
| 152 | func TestBinder_Chunked(t *testing.T) { |
| 153 | handler := &mockHandler{ |
| 154 | t: t, |
| 155 | chunked: true, |
| 156 | } |
| 157 | |
| 158 | client := &http.Client{ |
| 159 | Transport: NewBinder(handler), |
| 160 | } |
| 161 | |
| 162 | req, err := http.NewRequest("GET", "http://example.com/path", strings.NewReader("body")) |
| 163 | if err != nil { |
| 164 | t.Fatal(err) |
| 165 | } |
| 166 | |
| 167 | req.ContentLength = -1 |
| 168 | |
| 169 | resp, err := client.Do(req) |
| 170 | if err != nil { |
| 171 | t.Fatal(err) |
| 172 | } |
| 173 | |
| 174 | assert.Equal(t, []string{"chunked"}, resp.Request.TransferEncoding) |
| 175 | assert.Equal(t, []string{"chunked"}, resp.TransferEncoding) |
| 176 | } |
| 177 | |
| 178 | func TestFastBinder_Basic(t *testing.T) { |
| 179 | handler := func(ctx *fasthttp.RequestCtx) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…