Browse Source

Trying a new fix.

Javier Provecho Fernandez 10 years ago
parent
commit
6db7a17513
1 changed files with 3 additions and 2 deletions
  1. 3 2
      context_test.go

+ 3 - 2
context_test.go

@@ -7,11 +7,11 @@ package gin
 import (
 import (
 	"bytes"
 	"bytes"
 	"errors"
 	"errors"
-	"fmt"
 	"html/template"
 	"html/template"
 	"mime/multipart"
 	"mime/multipart"
 	"net/http"
 	"net/http"
 	"net/http/httptest"
 	"net/http/httptest"
+	"strings"
 	"testing"
 	"testing"
 	"time"
 	"time"
 
 
@@ -352,7 +352,8 @@ func TestContextRenderSSE(t *testing.T) {
 		"bar": "foo",
 		"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) {
 func TestContextRenderFile(t *testing.T) {