mirror of https://github.com/gin-gonic/gin.git
Fix MiddlewareWrite in middleware_test.go
This commit is contained in:
parent
8553030656
commit
3e8884a7f1
|
@ -6,6 +6,7 @@ package gin
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
@ -245,11 +246,5 @@ func TestMiddlewareWrite(t *testing.T) {
|
||||||
w := performRequest(router, "GET", "/")
|
w := performRequest(router, "GET", "/")
|
||||||
|
|
||||||
assert.Equal(t, w.Code, 400)
|
assert.Equal(t, w.Code, 400)
|
||||||
assert.Equal(t, w.Body.String(), `hola
|
assert.Equal(t, strings.Replace(w.Body.String(), " ", "", -1), strings.Replace("hola\n<map><foo>bar</foo></map>{\"foo\":\"bar\"}\n{\"foo\":\"bar\"}\nevent:test\ndata:message\n\n", " ", "", -1))
|
||||||
<map><foo>bar</foo></map>{"foo":"bar"}
|
|
||||||
{"foo":"bar"}
|
|
||||||
event:test
|
|
||||||
data:message
|
|
||||||
|
|
||||||
`)
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue