Browse Source

Add complementary test for patterns with pipe

pull/89/head
Philippe Lafoucrière 11 years ago
parent
commit
e98fd88cbd
  1. 9
      mux_test.go

9
mux_test.go

@ -162,6 +162,15 @@ func TestHost(t *testing.T) { @@ -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