(t *testing.T)
| 306 | } |
| 307 | |
| 308 | func TestLoadHTMLFilesFuncMap(t *testing.T) { |
| 309 | ts := setupHTMLFiles( |
| 310 | t, |
| 311 | TestMode, |
| 312 | false, |
| 313 | func(router *Engine) { |
| 314 | router.LoadHTMLFiles("./testdata/template/hello.tmpl", "./testdata/template/raw.tmpl") |
| 315 | }, |
| 316 | ) |
| 317 | defer ts.Close() |
| 318 | |
| 319 | res, err := http.Get(ts.URL + "/raw") |
| 320 | if err != nil { |
| 321 | t.Error(err) |
| 322 | } |
| 323 | |
| 324 | resp, _ := io.ReadAll(res.Body) |
| 325 | assert.Equal(t, "Date: 2017/07/01", string(resp)) |
| 326 | } |
| 327 | |
| 328 | var tmplFS = http.Dir("testdata/template") |
| 329 |
nothing calls this directly
no test coverage detected