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

Function TestDebugPrintRouteFunc

debug_test.go:77–87  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

75}
76
77func TestDebugPrintRouteFunc(t *testing.T) {
78 DebugPrintRouteFunc = func(httpMethod, absolutePath, handlerName string, nuHandlers int) {
79 fmt.Fprintf(DefaultWriter, "[GIN-debug] %-6s %-40s --> %s (%d handlers)\n", httpMethod, absolutePath, handlerName, nuHandlers)
80 }
81 re := captureOutput(t, func() {
82 SetMode(DebugMode)
83 debugPrintRoute(http.MethodGet, "/path/to/route/:param1/:param2", HandlersChain{func(c *Context) {}, handlerNameTest})
84 SetMode(TestMode)
85 })
86 assert.Regexp(t, `^\[GIN-debug\] GET /path/to/route/:param1/:param2 --> (.*/vendor/)?github.com/gin-gonic/gin.handlerNameTest \(2 handlers\)\n$`, re)
87}
88
89func TestDebugPrintLoadTemplate(t *testing.T) {
90 re := captureOutput(t, func() {

Callers

nothing calls this directly

Calls 3

captureOutputFunction · 0.85
SetModeFunction · 0.85
debugPrintRouteFunction · 0.85

Tested by

no test coverage detected