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

Function TestLoadHTMLFSFuncMap

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

Source from the content-addressed store, hash-verified

415}
416
417func TestLoadHTMLFSFuncMap(t *testing.T) {
418 ts := setupHTMLFiles(
419 t,
420 TestMode,
421 false,
422 func(router *Engine) {
423 router.LoadHTMLFS(tmplFS, "hello.tmpl", "raw.tmpl")
424 },
425 )
426 defer ts.Close()
427
428 res, err := http.Get(ts.URL + "/raw")
429 if err != nil {
430 t.Error(err)
431 }
432
433 resp, _ := io.ReadAll(res.Body)
434 assert.Equal(t, "Date: 2017/07/01", string(resp))
435}
436
437func TestAddRoute(t *testing.T) {
438 router := New()

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