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

Function TestLoadHTMLGlobTestMode

gin_test.go:123–141  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

121}
122
123func TestLoadHTMLGlobTestMode(t *testing.T) {
124 ts := setupHTMLFiles(
125 t,
126 TestMode,
127 false,
128 func(router *Engine) {
129 router.LoadHTMLGlob("./testdata/template/*")
130 },
131 )
132 defer ts.Close()
133
134 res, err := http.Get(ts.URL + "/test")
135 if err != nil {
136 t.Error(err)
137 }
138
139 resp, _ := io.ReadAll(res.Body)
140 assert.Equal(t, "<h1>Hello world</h1>", string(resp))
141}
142
143func TestLoadHTMLGlobReleaseMode(t *testing.T) {
144 ts := setupHTMLFiles(

Callers

nothing calls this directly

Calls 5

setupHTMLFilesFunction · 0.85
LoadHTMLGlobMethod · 0.80
CloseMethod · 0.80
GetMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected