(t *testing.T)
| 34 | } |
| 35 | |
| 36 | func TestPrinter_Compact(t *testing.T) { |
| 37 | cases := []struct { |
| 38 | name string |
| 39 | request *http.Request |
| 40 | response *http.Response |
| 41 | }{ |
| 42 | { |
| 43 | name: "nil request and response", |
| 44 | request: nil, |
| 45 | response: nil, |
| 46 | }, |
| 47 | { |
| 48 | name: "has body", |
| 49 | request: httpRequest(strings.NewReader("test")), |
| 50 | response: httpResponse(strings.NewReader("test")), |
| 51 | }, |
| 52 | { |
| 53 | name: "no body", |
| 54 | request: httpRequest(nil), |
| 55 | response: httpResponse(nil), |
| 56 | }, |
| 57 | } |
| 58 | |
| 59 | for _, tc := range cases { |
| 60 | t.Run(tc.name, func(t *testing.T) { |
| 61 | printer := NewCompactPrinter(t) |
| 62 | |
| 63 | printer.Request(tc.request) |
| 64 | printer.Response(tc.response, 0) |
| 65 | }) |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | func TestPrinter_Curl(t *testing.T) { |
| 70 | cases := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…