Skip to content

Commit

Permalink
Skip Intercepted Header test for go <1.6
Browse files Browse the repository at this point in the history
Signed-off-by: Thibault Jamet <tjamet@users.noreply.github.com>
  • Loading branch information
tjamet committed Mar 7, 2018
1 parent 12d5578 commit d1262bc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions context_test.go
Expand Up @@ -13,6 +13,8 @@ import (
"net/http"
"net/http/httptest"
"reflect"
"runtime"
"strconv"
"strings"
"testing"
"time"
Expand Down Expand Up @@ -1389,6 +1391,12 @@ func (i interceptedWriter) WriteHeader(code int) {
}

func TestInterceptedHeader(t *testing.T) {
if strings.HasPrefix(runtime.Version(), "go1.") {
v, err := strconv.Atoi(strings.SplitAfterN(runtime.Version(), ".", 2)[1])
if err != nil || v < 7 {
t.Skipf("This test is relying on httptest.ResponseRecorder.Result not implementein version %s", runtime.Version())
}
}
w := httptest.NewRecorder()
c, r := CreateTestContext(w)

Expand Down

0 comments on commit d1262bc

Please sign in to comment.