mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
phase 2: mattes/migrate -> migratex (#848)
* move mattes migrations to migratex * changes format of migrations to migratex format * updates test runner to use new interface (double checked this with printlns, the tests go fully down and then up, and work on pg/mysql) * remove mattes/migrate * update tests from deps * update readme * fix other file extensions
This commit is contained in:
32
vendor/github.com/prometheus/common/route/route_test.go
generated
vendored
32
vendor/github.com/prometheus/common/route/route_test.go
generated
vendored
@@ -42,3 +42,35 @@ func TestContext(t *testing.T) {
|
||||
}
|
||||
router.ServeHTTP(nil, r)
|
||||
}
|
||||
|
||||
func TestInstrumentation(t *testing.T) {
|
||||
var got string
|
||||
cases := []struct {
|
||||
router *Router
|
||||
want string
|
||||
}{
|
||||
{
|
||||
router: New(),
|
||||
want: "",
|
||||
}, {
|
||||
router: New().WithInstrumentation(func(handlerName string, handler http.HandlerFunc) http.HandlerFunc {
|
||||
got = handlerName
|
||||
return handler
|
||||
}),
|
||||
want: "/foo",
|
||||
},
|
||||
}
|
||||
|
||||
for _, c := range cases {
|
||||
c.router.Get("/foo", func(w http.ResponseWriter, r *http.Request) {})
|
||||
|
||||
r, err := http.NewRequest("GET", "http://localhost:9090/foo", nil)
|
||||
if err != nil {
|
||||
t.Fatalf("Error building test request: %s", err)
|
||||
}
|
||||
c.router.ServeHTTP(nil, r)
|
||||
if c.want != got {
|
||||
t.Fatalf("Unexpected value: want %q, got %q", c.want, got)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user