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

Function TestLoadHTMLFilesDebugMode

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

Source from the content-addressed store, hash-verified

239}
240
241func TestLoadHTMLFilesDebugMode(t *testing.T) {
242 ts := setupHTMLFiles(
243 t,
244 DebugMode,
245 false,
246 func(router *Engine) {
247 router.LoadHTMLFiles("./testdata/template/hello.tmpl", "./testdata/template/raw.tmpl")
248 },
249 )
250 defer ts.Close()
251
252 res, err := http.Get(ts.URL + "/test")
253 if err != nil {
254 t.Error(err)
255 }
256
257 resp, _ := io.ReadAll(res.Body)
258 assert.Equal(t, "<h1>Hello world</h1>", string(resp))
259}
260
261func TestLoadHTMLFilesReleaseMode(t *testing.T) {
262 ts := setupHTMLFiles(

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected