(t *testing.T)
| 67 | } |
| 68 | |
| 69 | func TestPrinter_Curl(t *testing.T) { |
| 70 | cases := []struct { |
| 71 | name string |
| 72 | request *http.Request |
| 73 | response *http.Response |
| 74 | }{ |
| 75 | { |
| 76 | name: "nil request and response", |
| 77 | request: nil, |
| 78 | response: nil, |
| 79 | }, |
| 80 | { |
| 81 | name: "has body", |
| 82 | request: httpRequest(strings.NewReader("test")), |
| 83 | response: httpResponse(strings.NewReader("test")), |
| 84 | }, |
| 85 | { |
| 86 | name: "no body", |
| 87 | request: httpRequest(nil), |
| 88 | response: httpResponse(nil), |
| 89 | }, |
| 90 | } |
| 91 | |
| 92 | for _, tc := range cases { |
| 93 | t.Run(tc.name, func(t *testing.T) { |
| 94 | printer := NewCurlPrinter(t) |
| 95 | |
| 96 | printer.Request(tc.request) |
| 97 | printer.Response(tc.response, 0) |
| 98 | }) |
| 99 | } |
| 100 | } |
| 101 | |
| 102 | func TestPrinter_Debug(t *testing.T) { |
| 103 | cases := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…