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

Function TestLoadHTMLGlobReleaseMode

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

Source from the content-addressed store, hash-verified

141}
142
143func TestLoadHTMLGlobReleaseMode(t *testing.T) {
144 ts := setupHTMLFiles(
145 t,
146 ReleaseMode,
147 false,
148 func(router *Engine) {
149 router.LoadHTMLGlob("./testdata/template/*")
150 },
151 )
152 defer ts.Close()
153
154 res, err := http.Get(ts.URL + "/test")
155 if err != nil {
156 t.Error(err)
157 }
158
159 resp, _ := io.ReadAll(res.Body)
160 assert.Equal(t, "<h1>Hello world</h1>", string(resp))
161}
162
163func TestLoadHTMLGlobUsingTLS(t *testing.T) {
164 ts := setupHTMLFiles(

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