summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/gorilla/mux/context_native_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/gorilla/mux/context_native_test.go')
-rw-r--r--vendor/github.com/gorilla/mux/context_native_test.go32
1 files changed, 0 insertions, 32 deletions
diff --git a/vendor/github.com/gorilla/mux/context_native_test.go b/vendor/github.com/gorilla/mux/context_native_test.go
deleted file mode 100644
index c150edf01..000000000
--- a/vendor/github.com/gorilla/mux/context_native_test.go
+++ /dev/null
@@ -1,32 +0,0 @@
-// +build go1.7
-
-package mux
-
-import (
- "context"
- "net/http"
- "testing"
- "time"
-)
-
-func TestNativeContextMiddleware(t *testing.T) {
- withTimeout := func(h http.Handler) http.Handler {
- return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- ctx, cancel := context.WithTimeout(r.Context(), time.Minute)
- defer cancel()
- h.ServeHTTP(w, r.WithContext(ctx))
- })
- }
-
- r := NewRouter()
- r.Handle("/path/{foo}", withTimeout(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- vars := Vars(r)
- if vars["foo"] != "bar" {
- t.Fatal("Expected foo var to be set")
- }
- })))
-
- rec := NewRecorder()
- req := newRequest("GET", "/path/bar")
- r.ServeHTTP(rec, req)
-}