From 761532a3a5c565de3412b22f91b97cf3a2cb011c Mon Sep 17 00:00:00 2001 From: kiyon Date: Sat, 18 Jul 2020 08:44:32 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=97=20improve=20ctx.Render=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ctx_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ctx_test.go b/ctx_test.go index 5b871816af..8939d40cad 100644 --- a/ctx_test.go +++ b/ctx_test.go @@ -23,6 +23,8 @@ import ( "text/template" "time" + "github.com/valyala/bytebufferpool" + utils "github.com/gofiber/utils" fasthttp "github.com/valyala/fasthttp" ) @@ -1414,6 +1416,11 @@ func Test_Ctx_Render(t *testing.T) { err := ctx.Render("./.github/TEST_DATA/template.html", Map{ "Title": "Hello, World!", }) + + buf := bytebufferpool.Get() + _, _ = buf.WriteString("overwrite") + defer bytebufferpool.Put(buf) + utils.AssertEqual(t, nil, err) utils.AssertEqual(t, "

Hello, World!

", string(ctx.Fasthttp.Response.Body()))