Skip to content

Commit

Permalink
Merge pull request #89 from gemnasium/add_tests_for_pipe
Browse files Browse the repository at this point in the history
Add complementary test for patterns with pipe
  • Loading branch information
kisielk committed May 5, 2015
2 parents 660d31f + e98fd88 commit 94903de
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions mux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 94903de

Please sign in to comment.