From f62648ab43b25fe538f9dd78e986a5177ced65e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Flc=E3=82=9B?= Date: Mon, 11 Mar 2024 23:16:04 +0800 Subject: [PATCH] fix(engine): fix unit test --- context_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/context_test.go b/context_test.go index 33cc43f9..d3320a31 100644 --- a/context_test.go +++ b/context_test.go @@ -24,10 +24,11 @@ import ( "time" "github.com/gin-contrib/sse" - "github.com/gin-gonic/gin/binding" - testdata "github.com/gin-gonic/gin/testdata/protoexample" "github.com/stretchr/testify/assert" "google.golang.org/protobuf/proto" + + "github.com/gin-gonic/gin/binding" + testdata "github.com/gin-gonic/gin/testdata/protoexample" ) var _ context.Context = (*Context)(nil) @@ -1044,7 +1045,7 @@ func TestContextRenderAndEscapeAttachment(t *testing.T) { c.FileAttachment("./gin.go", maliciousFilename) assert.Equal(t, 200, w.Code) - assert.Contains(t, w.Body.String(), "func New() *Engine {") + assert.Contains(t, w.Body.String(), "func New(opts ...OptionFunc) *Engine {") assert.Equal(t, fmt.Sprintf("attachment; filename=\"%s\"", actualEscapedResponseFilename), w.Header().Get("Content-Disposition")) }