Vendor dependencies

This commit is contained in:
Alexander Neumann
2016-12-28 21:41:04 +01:00
committed by Zlatko Čalušić
parent 2f0a16d8b7
commit 6054876201
541 changed files with 139974 additions and 0 deletions

39
vendor/goji.io/mux_test.go generated vendored Normal file
View File

@@ -0,0 +1,39 @@
package goji
import (
"context"
"net/http"
"testing"
"goji.io/internal"
)
func TestMuxExistingPath(t *testing.T) {
m := NewMux()
handler := func(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
if path := ctx.Value(internal.Path).(string); path != "/" {
t.Errorf("expected path=/, got %q", path)
}
}
m.HandleFunc(boolPattern(true), handler)
w, r := wr()
ctx := context.WithValue(context.Background(), internal.Path, "/hello")
r = r.WithContext(ctx)
m.ServeHTTP(w, r)
}
func TestSubMuxExistingPath(t *testing.T) {
m := SubMux()
handler := func(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
if path := ctx.Value(internal.Path).(string); path != "/hello" {
t.Errorf("expected path=/hello, got %q", path)
}
}
m.HandleFunc(boolPattern(true), handler)
w, r := wr()
ctx := context.WithValue(context.Background(), internal.Path, "/hello")
r = r.WithContext(ctx)
m.ServeHTTP(w, r)
}