(t *testing.T)
| 978 | } |
| 979 | |
| 980 | func TestTreeInvalidEscape(t *testing.T) { |
| 981 | routes := map[string]bool{ |
| 982 | "/r1/r": true, |
| 983 | "/r2/:r": true, |
| 984 | "/r3/\\:r": true, |
| 985 | } |
| 986 | tree := &node{} |
| 987 | for route, valid := range routes { |
| 988 | recv := catchPanic(func() { |
| 989 | tree.addRoute(route, fakeHandler(route)) |
| 990 | }) |
| 991 | if recv == nil != valid { |
| 992 | t.Fatalf("%s should be %t but got %v", route, valid, recv) |
| 993 | } |
| 994 | } |
| 995 | } |
| 996 | |
| 997 | func TestWildcardInvalidSlash(t *testing.T) { |
| 998 | const panicMsgPrefix = "no / before catch-all in path" |
nothing calls this directly
no test coverage detected