MCPcopy
hub / github.com/gin-gonic/gin / TestRouterGroupCombineHandlersTooManyHandlers

Function TestRouterGroupCombineHandlersTooManyHandlers

routergroup_test.go:199–209  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

197}
198
199func TestRouterGroupCombineHandlersTooManyHandlers(t *testing.T) {
200 group := &RouterGroup{
201 Handlers: make(HandlersChain, MaxHandlers), // Assume group already has MaxHandlers middleware
202 }
203 tooManyHandlers := make(HandlersChain, MaxHandlers) // Add MaxHandlers more, total 2 * MaxHandlers
204
205 // This should trigger panic
206 assert.Panics(t, func() {
207 group.combineHandlers(tooManyHandlers)
208 }, "should panic due to too many handlers")
209}
210
211func TestRouterGroupCombineHandlersEmptySliceNotNil(t *testing.T) {
212 group := &RouterGroup{

Callers

nothing calls this directly

Calls 1

combineHandlersMethod · 0.95

Tested by

no test coverage detected