Skip to content

Commit 0fa371f

Browse files
committed
Make sure the consistent ph name tests are complete
1 parent a215b4d commit 0fa371f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

rest/trie/impl_test.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,16 +239,20 @@ func TestConsistentPlaceholderName(t *testing.T) {
239239
trie.AddRoute("GET", "/r/:id", "oneph")
240240
err := trie.AddRoute("GET", "/r/:rid/other", "twoph")
241241
if err == nil {
242-
t.Error("Should have died on adding second route")
242+
t.Error("Should have died on inconsistent placeholder name")
243243
}
244244

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

251-
// TODO *param
251+
trie.AddRoute("GET", "/r/*id", "oneph")
252+
err = trie.AddRoute("GET", "/r/*rid", "twoph")
253+
if err == nil {
254+
t.Error("Should have died on duplicated route")
255+
}
252256
}
253257

254258
func TestDuplicateName(t *testing.T) {

0 commit comments

Comments
 (0)