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() {
262
262
263
263
test ('can mount dynamic routes with multiple parameters' , () async {
264
264
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 ) {
267
267
var router = Router ();
268
- router.get ('/' , (r) => Response .ok ('$second $fourth ' ));
268
+ router.get ('/' , (r) => Response .ok ('$second ${ int . parse ( fourthNum )} ' ));
269
269
return router (request);
270
270
});
271
271
272
272
server.mount (app);
273
273
274
- expect (await get ('/first/hello/third/bye /last' ), 'hello bye ' );
274
+ expect (await get ('/first/hello/third/12 /last' ), 'hello 12 ' );
275
275
});
276
276
277
277
test ('can mount dynamic routes with regexp' , () async {
You can’t perform that action at this time.
0 commit comments