Browse Source

Merge pull request #89 from gemnasium/add_tests_for_pipe

Add complementary test for patterns with pipe
Kamil Kisiel 11 years ago
parent
commit
94903de8c9
1 changed files with 9 additions and 0 deletions
  1. +9
    -0
      mux_test.go

+ 9
- 0
mux_test.go View File

@ -162,6 +162,15 @@ func TestHost(t *testing.T) {
path: "/a/product_name/1",
shouldMatch: true,
},
{
title: "Path route with multiple patterns with pipe, match",
route: new(Route).Path("/{category:a|b/c}/{product}/{id:[0-9]+}"),
request: newRequest("GET", "http://localhost/b/c/product_name/1"),
vars: map[string]string{"category": "b/c", "product": "product_name", "id": "1"},
host: "",
path: "/b/c/product_name/1",
shouldMatch: true,
},
}
for _, test := range tests {
testRoute(t, test)


Loading…
Cancel
Save