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

Function TestDebugPrint

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

Source from the content-addressed store, hash-verified

30}
31
32func TestDebugPrint(t *testing.T) {
33 re := captureOutput(t, func() {
34 SetMode(DebugMode)
35 SetMode(ReleaseMode)
36 debugPrint("DEBUG this!")
37 SetMode(TestMode)
38 debugPrint("DEBUG this!")
39 SetMode(DebugMode)
40 debugPrint("these are %d %s", 2, "error messages")
41 SetMode(TestMode)
42 })
43 assert.Equal(t, "[GIN-debug] these are 2 error messages\n", re)
44}
45
46func TestDebugPrintFunc(t *testing.T) {
47 DebugPrintFunc = func(format string, values ...any) {

Callers

nothing calls this directly

Calls 3

captureOutputFunction · 0.85
SetModeFunction · 0.85
debugPrintFunction · 0.85

Tested by

no test coverage detected