(t *testing.T)
| 666 | } |
| 667 | |
| 668 | func TestContextCopy(t *testing.T) { |
| 669 | c, _ := CreateTestContext(httptest.NewRecorder()) |
| 670 | c.index = 2 |
| 671 | c.Request, _ = http.NewRequest(http.MethodPost, "/hola", nil) |
| 672 | c.handlers = HandlersChain{func(c *Context) {}} |
| 673 | c.Params = Params{Param{Key: "foo", Value: "bar"}} |
| 674 | c.Set("foo", "bar") |
| 675 | c.fullPath = "/hola" |
| 676 | |
| 677 | cp := c.Copy() |
| 678 | assert.Nil(t, cp.handlers) |
| 679 | assert.Nil(t, cp.writermem.ResponseWriter) |
| 680 | assert.Equal(t, &cp.writermem, cp.Writer.(*responseWriter)) |
| 681 | assert.Equal(t, cp.Request, c.Request) |
| 682 | assert.Equal(t, abortIndex, cp.index) |
| 683 | assert.Equal(t, cp.Keys, c.Keys) |
| 684 | assert.Equal(t, cp.engine, c.engine) |
| 685 | assert.Equal(t, cp.Params, c.Params) |
| 686 | cp.Set("foo", "notBar") |
| 687 | assert.NotEqual(t, cp.Keys["foo"], c.Keys["foo"]) |
| 688 | assert.Equal(t, cp.fullPath, c.fullPath) |
| 689 | } |
| 690 | |
| 691 | func TestContextHandlerName(t *testing.T) { |
| 692 | c, _ := CreateTestContext(httptest.NewRecorder()) |
nothing calls this directly
no test coverage detected