1
0
mirror of https://github.com/labstack/echo.git synced 2025-06-23 00:38:07 +02:00

Bumped to v1.3

Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
Vishal Rana
2015-12-01 11:22:45 -08:00
parent f54cdd86d0
commit 9650c39055
13 changed files with 86 additions and 68 deletions

View File

@ -33,9 +33,10 @@ func (c *closeNotifyingRecorder) CloseNotify() <-chan bool {
}
func TestGzip(t *testing.T) {
e := echo.New()
req, _ := http.NewRequest(echo.GET, "/", nil)
rec := httptest.NewRecorder()
c := echo.NewContext(req, echo.NewResponse(rec), echo.New())
c := echo.NewContext(req, echo.NewResponse(rec, e), e)
h := func(c *echo.Context) error {
c.Response().Write([]byte("test")) // For Content-Type sniffing
return nil
@ -49,7 +50,7 @@ func TestGzip(t *testing.T) {
req, _ = http.NewRequest(echo.GET, "/", nil)
req.Header.Set(echo.AcceptEncoding, "gzip")
rec = httptest.NewRecorder()
c = echo.NewContext(req, echo.NewResponse(rec), echo.New())
c = echo.NewContext(req, echo.NewResponse(rec, e), e)
// Gzip
Gzip()(h)(c)
@ -121,7 +122,6 @@ func TestGzipCloseNotify(t *testing.T) {
}
func BenchmarkGzip(b *testing.B) {
b.StopTimer()
b.ReportAllocs()
@ -135,8 +135,9 @@ func BenchmarkGzip(b *testing.B) {
b.StartTimer()
for i := 0; i < b.N; i++ {
e := echo.New()
rec := httptest.NewRecorder()
c := echo.NewContext(req, echo.NewResponse(rec), echo.New())
c := echo.NewContext(req, echo.NewResponse(rec, e), e)
Gzip()(h)(c)
}