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

32
vendor/goji.io/dispatch_test.go generated vendored Normal file
View File

@@ -0,0 +1,32 @@
package goji
import (
"context"
"net/http"
"testing"
"goji.io/internal"
)
func TestDispatch(t *testing.T) {
t.Parallel()
var d dispatch
w, r := wr()
d.ServeHTTP(w, r)
if w.Code != 404 {
t.Errorf("status: expected %d, got %d", 404, w.Code)
}
w, r = wr()
h := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(123)
})
ctx := context.WithValue(context.Background(), internal.Handler, h)
r = r.WithContext(ctx)
d.ServeHTTP(w, r)
if w.Code != 123 {
t.Errorf("status: expected %d, got %d", 123, w.Code)
}
}