go test -run Test_Ctx_Render_Engine
(t *testing.T)
| 8052 | |
| 8053 | // go test -run Test_Ctx_Render_Engine |
| 8054 | func Test_Ctx_Render_Engine(t *testing.T) { |
| 8055 | t.Parallel() |
| 8056 | engine := &testTemplateEngine{} |
| 8057 | require.NoError(t, engine.Load()) |
| 8058 | app := New() |
| 8059 | app.config.Views = engine |
| 8060 | c := app.AcquireCtx(&fasthttp.RequestCtx{}) |
| 8061 | |
| 8062 | err := c.Render("index.tmpl", Map{ |
| 8063 | "Title": "Hello, World!", |
| 8064 | }) |
| 8065 | require.NoError(t, err) |
| 8066 | require.Equal(t, "<h1>Hello, World!</h1>", string(c.Response().Body())) |
| 8067 | } |
| 8068 | |
| 8069 | // go test -run Test_Ctx_Render_Engine_With_View_Layout |
| 8070 | func Test_Ctx_Render_Engine_With_View_Layout(t *testing.T) { |