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

Function TestLoadHTMLFilesReleaseMode

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

Source from the content-addressed store, hash-verified

259}
260
261func TestLoadHTMLFilesReleaseMode(t *testing.T) {
262 ts := setupHTMLFiles(
263 t,
264 ReleaseMode,
265 false,
266 func(router *Engine) {
267 router.LoadHTMLFiles("./testdata/template/hello.tmpl", "./testdata/template/raw.tmpl")
268 },
269 )
270 defer ts.Close()
271
272 res, err := http.Get(ts.URL + "/test")
273 if err != nil {
274 t.Error(err)
275 }
276
277 resp, _ := io.ReadAll(res.Body)
278 assert.Equal(t, "<h1>Hello world</h1>", string(resp))
279}
280
281func TestLoadHTMLFilesUsingTLS(t *testing.T) {
282 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