(t *testing.T)
| 354 | } |
| 355 | |
| 356 | func TestTreeDoubleWildcard(t *testing.T) { |
| 357 | const panicMsg = "only one wildcard per path segment is allowed" |
| 358 | |
| 359 | routes := [...]string{ |
| 360 | "/:foo:bar", |
| 361 | "/:foo:bar/", |
| 362 | "/:foo*bar", |
| 363 | } |
| 364 | |
| 365 | for _, route := range routes { |
| 366 | tree := &node{} |
| 367 | recv := catchPanic(func() { |
| 368 | tree.addRoute(route, nil) |
| 369 | }) |
| 370 | |
| 371 | if rs, ok := recv.(string); !ok || !strings.HasPrefix(rs, panicMsg) { |
| 372 | t.Fatalf(`"Expected panic "%s" for route '%s', got "%v"`, panicMsg, route, recv) |
| 373 | } |
| 374 | } |
| 375 | } |
| 376 | |
| 377 | /*func TestTreeDuplicateWildcard(t *testing.T) { |
| 378 | tree := &node{} |
nothing calls this directly
no test coverage detected