Skip to content
Myr

Test for named capture groups

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Tj Holowaychuk · committed by Tj Holowaychuk · parent 77add42 · Browse files · 1 file+5 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+5 added−1 removed

  • tests:+5 added−1 removed

1 file+5 added−1 removed

modified:test/express.test.js+5 added-1 removed
426 unmodified lines
427 428 'test named capture groups': function(){429 var app = express.createServer();430431 app.get('/user/:id(\d+)', function(req, res){431 app.get('/user/:id([0-9]{2,10})', function(req, res){432 res.send('user ' + req.params.id);433 });434435 assert.response(app,436 { url: '/user/12' },437 { body: 'user 12' });438 439 assert.response(app,440 { url: '/user/ab' },441 { body: 'Cannot GET /user/ab' });442 },443 444 'test .param()': function(){445 var app = express.createServer();
44 unmodified lines