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

Function TestDebugPrintWARNINGSetHTMLTemplate

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

Source from the content-addressed store, hash-verified

97}
98
99func TestDebugPrintWARNINGSetHTMLTemplate(t *testing.T) {
100 re := captureOutput(t, func() {
101 SetMode(DebugMode)
102 debugPrintWARNINGSetHTMLTemplate()
103 SetMode(TestMode)
104 })
105 assert.Equal(t, "[GIN-debug] [WARNING] Since SetHTMLTemplate() is NOT thread-safe. It should only be called\nat initialization. ie. before any route is registered or the router is listening in a socket:\n\n\trouter := gin.Default()\n\trouter.SetHTMLTemplate(template) // << good place\n\n", re)
106}
107
108func TestDebugPrintWARNINGDefault(t *testing.T) {
109 re := captureOutput(t, func() {

Callers

nothing calls this directly

Calls 3

captureOutputFunction · 0.85
SetModeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…