summaryrefslogtreecommitdiff
path: root/router_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'router_test.go')
-rw-r--r--router_test.go21
1 files changed, 4 insertions, 17 deletions
diff --git a/router_test.go b/router_test.go
index e03d16f..5f09a63 100644
--- a/router_test.go
+++ b/router_test.go
@@ -10,7 +10,7 @@ func TestRouterStaticMatch(t *testing.T) {
r := NewRouter()
r.Add("GET", "/hello", dummy)
- h, params, _ := r.Find("GET", "/hello")
+ h, params := r.Find("GET", "/hello")
if h == nil {
t.Fatal("expected handler, got nil")
}
@@ -23,7 +23,7 @@ func TestRouterStaticNoMatch(t *testing.T) {
r := NewRouter()
r.Add("GET", "/hello", dummy)
- h, _, _ := r.Find("GET", "/nothello")
+ h, _ := r.Find("GET", "/nothello")
if h != nil {
t.Fatal("expected nil handler, got non-nil")
}
@@ -33,7 +33,7 @@ func TestRouterParamMatch(t *testing.T) {
r := NewRouter()
r.Add("GET", "/user/:id", dummy)
- h, params, _ := r.Find("GET", "/user/42")
+ h, params := r.Find("GET", "/user/42")
if h == nil {
t.Fatal("expected handler, got nil")
}
@@ -46,21 +46,8 @@ func TestRouterParamMismatch(t *testing.T) {
r := NewRouter()
r.Add("GET", "/user/:id", dummy)
- h, _, _ := r.Find("GET", "/user")
+ h, _ := r.Find("GET", "/user")
if h != nil {
t.Fatal("expected nil handler, got non-nil")
}
}
-
-func TestRouterQueryMatch(t *testing.T) {
- r := NewRouter()
- r.Add("GET", "/user", dummy)
-
- h, _, query := r.Find("GET", "/user?id=42")
- if h == nil {
- t.Fatal("expected handler, got nil")
- }
- if query["id"] != "42" {
- t.Fatalf("expected id=42, got %v", query)
- }
-}