From e98fd88cbd7216fd46d0b480a047d34748d603d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Lafoucrie=CC=80re?= Date: Tue, 10 Mar 2015 21:48:38 -0400 Subject: [PATCH] Add complementary test for patterns with pipe --- mux_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mux_test.go b/mux_test.go index 075dedb..6b2c1d2 100644 --- a/mux_test.go +++ b/mux_test.go @@ -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)