(t *testing.T)
| 537 | } |
| 538 | |
| 539 | func TestTreeDoubleWildcard(t *testing.T) { |
| 540 | const panicMsg = "only one wildcard per path segment is allowed" |
| 541 | |
| 542 | routes := [...]string{ |
| 543 | "/:foo:bar", |
| 544 | "/:foo:bar/", |
| 545 | "/:foo*bar", |
| 546 | } |
| 547 | |
| 548 | for _, route := range routes { |
| 549 | tree := &node{} |
| 550 | recv := catchPanic(func() { |
| 551 | tree.addRoute(route, nil) |
| 552 | }) |
| 553 | |
| 554 | if rs, ok := recv.(string); !ok || !strings.HasPrefix(rs, panicMsg) { |
| 555 | t.Fatalf(`"Expected panic "%s" for route '%s', got "%v"`, panicMsg, route, recv) |
| 556 | } |
| 557 | } |
| 558 | } |
| 559 | |
| 560 | /*func TestTreeDuplicateWildcard(t *testing.T) { |
| 561 | tree := &node{} |
nothing calls this directly
no test coverage detected