(t *testing.T)
| 75 | } |
| 76 | |
| 77 | func 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 | |
| 89 | func TestDebugPrintLoadTemplate(t *testing.T) { |
| 90 | re := captureOutput(t, func() { |
nothing calls this directly
no test coverage detected