@@ -69,7 +69,7 @@ func TestRouter(t *testing.T) {
6969 chiCtx := chi .RouteContext (req .Context ())
7070 res .method = req .Method
7171 res .pathParams = chiURLParamsToMap (chiCtx )
72- res .chiRoutePattern = util . ToPointer (chiCtx .RoutePattern ())
72+ res .chiRoutePattern = new (chiCtx.RoutePattern ())
7373 if mark != "" {
7474 res .handlerMarks = append (res .handlerMarks , mark )
7575 }
@@ -139,7 +139,7 @@ func TestRouter(t *testing.T) {
139139 testRoute (t , "GET /the-user/the-repo/other" , resultStruct {
140140 method : "GET" ,
141141 handlerMarks : []string {"not-found:/" },
142- chiRoutePattern : util . ToPointer ("" ),
142+ chiRoutePattern : new (""),
143143 })
144144 testRoute (t , "GET /the-user/the-repo/pulls" , resultStruct {
145145 method : "GET" ,
@@ -150,7 +150,7 @@ func TestRouter(t *testing.T) {
150150 method : "GET" ,
151151 pathParams : map [string ]string {"username" : "the-user" , "reponame" : "the-repo" , "type" : "issues" , "index" : "123" },
152152 handlerMarks : []string {"view-issue" },
153- chiRoutePattern : util . ToPointer ("/{username}/{reponame}/{type:issues|pulls}/{index}" ),
153+ chiRoutePattern : new ("/ {username }/ {reponame }/ {type :issues | pulls }/ {index }"),
154154 })
155155 testRoute (t , "GET /the-user/the-repo/issues/123?stop=hijack" , resultStruct {
156156 method : "GET" ,
@@ -228,7 +228,7 @@ func TestRouter(t *testing.T) {
228228 method : "GET" ,
229229 pathParams : map [string ]string {"username" : "the-user" , "reponame" : "the-repo" , "*" : "d1/d2/fn" , "dir" : "d1/d2" , "file" : "fn" },
230230 handlerMarks : []string {"s1" , "s2" , "s3" },
231- chiRoutePattern : util . ToPointer ("/api/v1/repos/{username}/{reponame}/branches/<dir:*>/<file:[a-z]{1,2}>" ),
231+ chiRoutePattern : new ("/ api / v1 / repos / {username }/ {reponame }/ branches / < dir :* > / < file :[a - z ]{1 ,2 }> "),
232232 })
233233 })
234234}
0 commit comments