diff options
author | Franck Cuny <franck@lumberjaph.net> | 2013-04-22 21:06:02 -0700 |
---|---|---|
committer | Franck Cuny <franck@lumberjaph.net> | 2013-04-22 21:06:02 -0700 |
commit | 4166296aab961347932515212abd7eac9bda01a8 (patch) | |
tree | 4a55b65e363594eb221b6c61ee643e5693355526 /router_test.go | |
parent | Add a very simple exemple to the framework. (diff) | |
download | path-router-4166296aab961347932515212abd7eac9bda01a8.tar.gz |
Routes inside the dispatcher private and check uniqueness of routes
There's no need to expose directly the list of routes inside the router, we will provide an interface to that later. Also, when adding a new routes, we verify that the route don't already exist, and if it's the case, we return an error.
Diffstat (limited to 'router_test.go')
-rw-r--r-- | router_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/router_test.go b/router_test.go index bc6bc0c..8ee2bcc 100644 --- a/router_test.go +++ b/router_test.go @@ -18,13 +18,13 @@ func TestBasic(t *testing.T) { router.AddRoute(&Route{Method: "GET", Path: "/blog/:year/:month/:day", Code: testRoute}) router.AddRoute(&Route{Method: "GET", Path: "/blog", Code: testRoute}) - if router.Routes[0].Path != "/" { + if router.routes[0].Path != "/" { t.Fatal() } - if router.Routes[1].Path != "/blog/:year/:month/:day" { + if router.routes[1].Path != "/blog/:year/:month/:day" { t.Fatal() } - if router.Routes[2].Path != "/blog" { + if router.routes[2].Path != "/blog" { t.Fatal() } } |