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

Function TestLoadHTMLFSDebugMode

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

Source from the content-addressed store, hash-verified

348}
349
350func TestLoadHTMLFSDebugMode(t *testing.T) {
351 ts := setupHTMLFiles(
352 t,
353 DebugMode,
354 false,
355 func(router *Engine) {
356 router.LoadHTMLFS(tmplFS, "hello.tmpl", "raw.tmpl")
357 },
358 )
359 defer ts.Close()
360
361 res, err := http.Get(ts.URL + "/test")
362 if err != nil {
363 t.Error(err)
364 }
365
366 resp, _ := io.ReadAll(res.Body)
367 assert.Equal(t, "<h1>Hello world</h1>", string(resp))
368}
369
370func TestLoadHTMLFSReleaseMode(t *testing.T) {
371 ts := setupHTMLFiles(

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected