diff --git a/middleware_test.go b/middleware_test.go index 61d27c9..3101d52 100644 --- a/middleware_test.go +++ b/middleware_test.go @@ -6,6 +6,7 @@ package gin import ( "errors" + "strings" "testing" @@ -245,11 +246,5 @@ func TestMiddlewareWrite(t *testing.T) { w := performRequest(router, "GET", "/") assert.Equal(t, w.Code, 400) - assert.Equal(t, w.Body.String(), `hola -bar{"foo":"bar"} -{"foo":"bar"} -event:test -data:message - -`) + assert.Equal(t, strings.Replace(w.Body.String(), " ", "", -1), strings.Replace("hola\nbar{\"foo\":\"bar\"}\n{\"foo\":\"bar\"}\nevent:test\ndata:message\n\n", " ", "", -1)) }