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

Function TestLoadHTMLGlobFromFuncMap

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

Source from the content-addressed store, hash-verified

188}
189
190func TestLoadHTMLGlobFromFuncMap(t *testing.T) {
191 ts := setupHTMLFiles(
192 t,
193 DebugMode,
194 false,
195 func(router *Engine) {
196 router.LoadHTMLGlob("./testdata/template/*")
197 },
198 )
199 defer ts.Close()
200
201 res, err := http.Get(ts.URL + "/raw")
202 if err != nil {
203 t.Error(err)
204 }
205
206 resp, _ := io.ReadAll(res.Body)
207 assert.Equal(t, "Date: 2017/07/01", string(resp))
208}
209
210func init() {
211 SetMode(TestMode)

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