From 6db7a175132b2859dee68c4f90cad1a663321077 Mon Sep 17 00:00:00 2001 From: Javier Provecho Fernandez Date: Fri, 25 Sep 2015 12:04:55 +0200 Subject: [PATCH] Trying a new fix. --- context_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/context_test.go b/context_test.go index d66e4eb..f8068b5 100644 --- a/context_test.go +++ b/context_test.go @@ -7,11 +7,11 @@ package gin import ( "bytes" "errors" - "fmt" "html/template" "mime/multipart" "net/http" "net/http/httptest" + "strings" "testing" "time" @@ -352,7 +352,8 @@ func TestContextRenderSSE(t *testing.T) { "bar": "foo", }) - assert.Equal(t, fmt.Sprintf("%v", w.Body), "event:float\ndata:1.5\n\nid:123\ndata:text\n\nevent:chat\ndata:{\"bar\":\"foo\",\"foo\":\"bar\"}\n\n") + assert.Equal(t, strings.Replace(w.Body.String(), " ", "", -1), strings.Replace("event:float\ndata:1.5\n\nid:123\ndata:text\n\nevent:chat\ndata:{\"bar\":\"foo\",\"foo\":\"bar\"}\n\n", " ", "", -1)) + //assert.Equal(t, fmt.Sprintf("%v", w.Body), "event:float\ndata:1.5\n\nid:123\ndata:text\n\nevent:chat\ndata:{\"bar\":\"foo\",\"foo\":\"bar\"}\n\n") } func TestContextRenderFile(t *testing.T) {