(t *testing.T)
| 328 | var tmplFS = http.Dir("testdata/template") |
| 329 | |
| 330 | func TestLoadHTMLFSTestMode(t *testing.T) { |
| 331 | ts := setupHTMLFiles( |
| 332 | t, |
| 333 | TestMode, |
| 334 | false, |
| 335 | func(router *Engine) { |
| 336 | router.LoadHTMLFS(tmplFS, "hello.tmpl", "raw.tmpl") |
| 337 | }, |
| 338 | ) |
| 339 | defer ts.Close() |
| 340 | |
| 341 | res, err := http.Get(ts.URL + "/test") |
| 342 | if err != nil { |
| 343 | t.Error(err) |
| 344 | } |
| 345 | |
| 346 | resp, _ := io.ReadAll(res.Body) |
| 347 | assert.Equal(t, "<h1>Hello world</h1>", string(resp)) |
| 348 | } |
| 349 | |
| 350 | func TestLoadHTMLFSDebugMode(t *testing.T) { |
| 351 | ts := setupHTMLFiles( |
nothing calls this directly
no test coverage detected