@@ -1124,6 +1124,8 @@ func TestRouterParam_escapeColon(t *testing.T) {
1124
1124
e := New ()
1125
1125
1126
1126
e .POST ("/files/a/long/file\\ :undelete" , handlerFunc )
1127
+ e .POST ("/multilevel\\ :undelete/second\\ :something" , handlerFunc )
1128
+ e .POST ("/mixed/:id/second\\ :something" , handlerFunc )
1127
1129
e .POST ("/v1/some/resource/name:customVerb" , handlerFunc )
1128
1130
1129
1131
var testCases = []struct {
@@ -1133,12 +1135,22 @@ func TestRouterParam_escapeColon(t *testing.T) {
1133
1135
expectError string
1134
1136
}{
1135
1137
{
1136
- whenURL : "/files/a/long/file\\ :undelete" ,
1138
+ whenURL : "/files/a/long/file:undelete" ,
1137
1139
expectRoute : "/files/a/long/file\\ :undelete" ,
1138
1140
expectParam : map [string ]string {},
1139
1141
},
1140
1142
{
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" ,
1142
1154
expectRoute : nil ,
1143
1155
expectError : "code=404, message=Not Found" ,
1144
1156
expectParam : nil ,
0 commit comments