fix Context.Next() - recheck len of handlers every iteration (#1745)
* fix Context.Next() - recheck len of handlers every iteration * add tests when Context.reset() can be called inside of handler TestEngineHandleContext TestContextResetInHandler TestRouterStaticFSFileNotFound * Context.Next() - format to while style
This commit is contained in:
committed by
thinkerou
parent
b056a34bdc
commit
4867ff9634
@ -1743,3 +1743,15 @@ func TestContextStreamWithClientGone(t *testing.T) {
|
||||
|
||||
assert.Equal(t, "test", w.Body.String())
|
||||
}
|
||||
|
||||
func TestContextResetInHandler(t *testing.T) {
|
||||
w := CreateTestResponseRecorder()
|
||||
c, _ := CreateTestContext(w)
|
||||
|
||||
c.handlers = []HandlerFunc{
|
||||
func(c *Context) { c.reset() },
|
||||
}
|
||||
assert.NotPanics(t, func() {
|
||||
c.Next()
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user