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

Function TestDebugPrintWARNINGNew

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

Source from the content-addressed store, hash-verified

125}
126
127func TestDebugPrintWARNINGNew(t *testing.T) {
128 re := captureOutput(t, func() {
129 SetMode(DebugMode)
130 debugPrintWARNINGNew()
131 SetMode(TestMode)
132 })
133 assert.Equal(t, "[GIN-debug] [WARNING] Running in \"debug\" mode. Switch to \"release\" mode in production.\n - using env:\texport GIN_MODE=release\n - using code:\tgin.SetMode(gin.ReleaseMode)\n\n", re)
134}
135
136func captureOutput(t *testing.T, f func()) string {
137 reader, writer, err := os.Pipe()

Callers

nothing calls this directly

Calls 3

captureOutputFunction · 0.85
SetModeFunction · 0.85
debugPrintWARNINGNewFunction · 0.85

Tested by

no test coverage detected