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

Function TestEngineHandleContext

gin_test.go:654–669  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

652}
653
654func TestEngineHandleContext(t *testing.T) {
655 r := New()
656 r.GET("/", func(c *Context) {
657 c.Request.URL.Path = "/v2"
658 r.HandleContext(c)
659 })
660 v2 := r.Group("/v2")
661 {
662 v2.GET("/", func(c *Context) {})
663 }
664
665 assert.NotPanics(t, func() {
666 w := PerformRequest(r, http.MethodGet, "/")
667 assert.Equal(t, 301, w.Code)
668 })
669}
670
671func TestEngineHandleContextManyReEntries(t *testing.T) {
672 expectValue := 10000

Callers

nothing calls this directly

Calls 5

NewFunction · 0.85
PerformRequestFunction · 0.85
HandleContextMethod · 0.80
GETMethod · 0.65
GroupMethod · 0.65

Tested by

no test coverage detected