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

Function TestLoadHTMLFSReleaseMode

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

Source from the content-addressed store, hash-verified

368}
369
370func TestLoadHTMLFSReleaseMode(t *testing.T) {
371 ts := setupHTMLFiles(
372 t,
373 ReleaseMode,
374 false,
375 func(router *Engine) {
376 router.LoadHTMLFS(tmplFS, "hello.tmpl", "raw.tmpl")
377 },
378 )
379 defer ts.Close()
380
381 res, err := http.Get(ts.URL + "/test")
382 if err != nil {
383 t.Error(err)
384 }
385
386 resp, _ := io.ReadAll(res.Body)
387 assert.Equal(t, "<h1>Hello world</h1>", string(resp))
388}
389
390func TestLoadHTMLFSUsingTLS(t *testing.T) {
391 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