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

Function TestContextHandlerNames

context_test.go:698–708  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

696}
697
698func TestContextHandlerNames(t *testing.T) {
699 c, _ := CreateTestContext(httptest.NewRecorder())
700 c.handlers = HandlersChain{func(c *Context) {}, nil, handlerNameTest, func(c *Context) {}, handlerNameTest2}
701
702 names := c.HandlerNames()
703
704 assert.Len(t, names, 4)
705 for _, name := range names {
706 assert.Regexp(t, `^(.*/vendor/)?(github\.com/gin-gonic/gin\.){1}(TestContextHandlerNames\.func.*){0,1}(handlerNameTest.*){0,1}`, name)
707 }
708}
709
710func handlerNameTest(c *Context) {
711}

Callers

nothing calls this directly

Calls 2

CreateTestContextFunction · 0.85
HandlerNamesMethod · 0.80

Tested by

no test coverage detected