(t *testing.T)
| 298 | } |
| 299 | |
| 300 | func TestContextHandlers(t *testing.T) { |
| 301 | c, _ := CreateTestContext(httptest.NewRecorder()) |
| 302 | assert.Nil(t, c.handlers) |
| 303 | assert.Nil(t, c.handlers.Last()) |
| 304 | |
| 305 | c.handlers = HandlersChain{} |
| 306 | assert.NotNil(t, c.handlers) |
| 307 | assert.Nil(t, c.handlers.Last()) |
| 308 | |
| 309 | f := func(c *Context) {} |
| 310 | g := func(c *Context) {} |
| 311 | |
| 312 | c.handlers = HandlersChain{f} |
| 313 | compareFunc(t, f, c.handlers.Last()) |
| 314 | |
| 315 | c.handlers = HandlersChain{f, g} |
| 316 | compareFunc(t, g, c.handlers.Last()) |
| 317 | } |
| 318 | |
| 319 | // TestContextSetGet tests that a parameter is set correctly on the |
| 320 | // current context and can be retrieved using Get. |
nothing calls this directly
no test coverage detected