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

Function TestDebugPrintFunc

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

Source from the content-addressed store, hash-verified

44}
45
46func TestDebugPrintFunc(t *testing.T) {
47 DebugPrintFunc = func(format string, values ...any) {
48 fmt.Fprintf(DefaultWriter, "[GIN-debug] "+format, values...)
49 }
50 re := captureOutput(t, func() {
51 SetMode(DebugMode)
52 debugPrint("debug print func test: %d", 123)
53 SetMode(TestMode)
54 })
55 assert.Regexp(t, `^\[GIN-debug\] debug print func test: 123`, re)
56}
57
58func TestDebugPrintError(t *testing.T) {
59 re := captureOutput(t, func() {

Callers

nothing calls this directly

Calls 3

captureOutputFunction · 0.85
SetModeFunction · 0.85
debugPrintFunction · 0.85

Tested by

no test coverage detected