(t *testing.T)
| 217 | } |
| 218 | |
| 219 | func TestContextCop(t *testing.T) { |
| 220 | // Create a new request without any correlation ID headers. |
| 221 | req, err := http.NewRequest("GET", "http://127.0.0.1:5000/blobs/fdsfsdsd", nil) |
| 222 | if err != nil { |
| 223 | t.Fatal(err) |
| 224 | } |
| 225 | |
| 226 | ctx, _ := gin.CreateTestContext(httptest.NewRecorder()) |
| 227 | ctx.Request = req |
| 228 | |
| 229 | pc := FromContext(ctx) |
| 230 | |
| 231 | pcCopy := pc.Copy() |
| 232 | if pcCopy.Request == nil { |
| 233 | t.Fatal("expected context copy request to not be nil") |
| 234 | } |
| 235 | if pcCopy.Request != pc.Request { |
| 236 | t.Fatal("expected context copy request to be the same as original") |
| 237 | } |
| 238 | } |
nothing calls this directly
no test coverage detected