@@ -1124,6 +1124,8 @@ func TestRouterParam_escapeColon(t *testing.T) {
11241124 e := New ()
11251125
11261126 e .POST ("/files/a/long/file\\ :undelete" , handlerFunc )
1127+ e .POST ("/multilevel\\ :undelete/second\\ :something" , handlerFunc )
1128+ e .POST ("/mixed/:id/second\\ :something" , handlerFunc )
11271129 e .POST ("/v1/some/resource/name:customVerb" , handlerFunc )
11281130
11291131 var testCases = []struct {
@@ -1133,12 +1135,22 @@ func TestRouterParam_escapeColon(t *testing.T) {
11331135 expectError string
11341136 }{
11351137 {
1136- whenURL : "/files/a/long/file\\ :undelete" ,
1138+ whenURL : "/files/a/long/file:undelete" ,
11371139 expectRoute : "/files/a/long/file\\ :undelete" ,
11381140 expectParam : map [string ]string {},
11391141 },
11401142 {
1141- whenURL : "/files/a/long/file\\ :notMatching" ,
1143+ whenURL : "/multilevel:undelete/second:something" ,
1144+ expectRoute : "/multilevel\\ :undelete/second\\ :something" ,
1145+ expectParam : map [string ]string {},
1146+ },
1147+ {
1148+ whenURL : "/mixed/123/second:something" ,
1149+ expectRoute : "/mixed/:id/second\\ :something" ,
1150+ expectParam : map [string ]string {"id" : "123" },
1151+ },
1152+ {
1153+ whenURL : "/files/a/long/file:notMatching" ,
11421154 expectRoute : nil ,
11431155 expectError : "code=404, message=Not Found" ,
11441156 expectParam : nil ,
0 commit comments