mirror of
https://github.com/labstack/echo.git
synced 2024-12-24 20:14:31 +02:00
Merge pull request #201 from syntaqx/master
Adding Response.Committed Getter
This commit is contained in:
commit
71ae409ea7
@ -74,6 +74,10 @@ func (r *Response) Size() int64 {
|
||||
return r.size
|
||||
}
|
||||
|
||||
func (r *Response) Committed() bool {
|
||||
return r.committed
|
||||
}
|
||||
|
||||
func (r *Response) reset(w http.ResponseWriter) {
|
||||
r.writer = w
|
||||
r.size = 0
|
||||
|
@ -1,10 +1,11 @@
|
||||
package echo
|
||||
|
||||
import (
|
||||
"github.com/stretchr/testify/assert"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestResponse(t *testing.T) {
|
||||
@ -46,6 +47,9 @@ func TestResponse(t *testing.T) {
|
||||
// Size
|
||||
assert.EqualValues(t, len(s), r.Size())
|
||||
|
||||
// Committed
|
||||
assert.Equal(t, true, r.Committed())
|
||||
|
||||
// Hijack
|
||||
assert.Panics(t, func() {
|
||||
r.Hijack()
|
||||
|
Loading…
Reference in New Issue
Block a user