Skip to content

Commit

Permalink
Make sure the consistent ph name tests are complete
Browse files Browse the repository at this point in the history
  • Loading branch information
ant0ine committed Jul 13, 2014
1 parent a215b4d commit 0fa371f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions rest/trie/impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,20 @@ func TestConsistentPlaceholderName(t *testing.T) {
trie.AddRoute("GET", "/r/:id", "oneph")
err := trie.AddRoute("GET", "/r/:rid/other", "twoph")
if err == nil {
t.Error("Should have died on adding second route")
t.Error("Should have died on inconsistent placeholder name")
}

trie.AddRoute("GET", "/r/#id", "oneph")
err = trie.AddRoute("GET", "/r/#rid/other", "twoph")
if err == nil {
t.Error("Should have died on adding second route")
t.Error("Should have died on inconsistent placeholder name")
}

// TODO *param
trie.AddRoute("GET", "/r/*id", "oneph")
err = trie.AddRoute("GET", "/r/*rid", "twoph")
if err == nil {
t.Error("Should have died on duplicated route")
}
}

func TestDuplicateName(t *testing.T) {
Expand Down

0 comments on commit 0fa371f

Please sign in to comment.