Trying a new fix.

This commit is contained in:
Javier Provecho Fernandez 2015-09-25 12:04:55 +02:00
parent aa934766b4
commit 6db7a17513

View File

@ -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) {