(t *testing.T)
| 125 | } |
| 126 | |
| 127 | func 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 | |
| 136 | func captureOutput(t *testing.T, f func()) string { |
| 137 | reader, writer, err := os.Pipe() |
nothing calls this directly
no test coverage detected