File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -262,16 +262,16 @@ void main() {
262262
263263 test ('can mount dynamic routes with multiple parameters' , () async {
264264 var app = Router ();
265- app.mount (r'/first/<second>/third/<fourth>/last' ,
266- (Request request, String second, String fourth ) {
265+ app.mount (r'/first/<second>/third/<fourth|\d+ >/last' ,
266+ (Request request, String second, String fourthNum ) {
267267 var router = Router ();
268- router.get ('/' , (r) => Response .ok ('$second $fourth ' ));
268+ router.get ('/' , (r) => Response .ok ('$second ${ int . parse ( fourthNum )} ' ));
269269 return router (request);
270270 });
271271
272272 server.mount (app);
273273
274- expect (await get ('/first/hello/third/bye /last' ), 'hello bye ' );
274+ expect (await get ('/first/hello/third/12 /last' ), 'hello 12 ' );
275275 });
276276
277277 test ('can mount dynamic routes with regexp' , () async {
You can’t perform that action at this time.
0 commit comments