Skip to content
Myr

tests for issues 1115 fix for utils

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

authored by riadh · committed by TJ Holowaychuk · parent 73bed61 · Browse files · 2 files+24 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

2 files+24 added−1 removed

  • tests:+23 added−0 removed
  • other:+1 added−1 removed

2 files+24 added−1 removed

modified:lib/utils.js+1 added-1 removed
271 unmodified lines
272 + '(?:'273 + (optional ? slash : '')274 + (format || '') + (capture || (format && '([^/.]+?)' || '([^/]+?)')) + ')'275 + (optional || '')276 + (star ? '(/*)' : '');276 + (star ? '(/*)?' : '');277 })278 .replace(/([\/.])/g, '\\$1')279 .replace(/\*/g, '(.*)');280 return new RegExp('^' + path + '$', sensitive ? '' : 'i');
1 unmodified line
modified:test/app.router.js+23 added
345 unmodified lines
346 .get('/api/users/0.json')347 .expect('users/0.json', done);348 })349 350 it('should not be greedy immediately after param', function(done){351 var app = express();352353 app.get('/user/:user*', function(req, res){354 res.end(req.params.user);355 });356357 request(app)358 .get('/user/122')359 .expect('122', done);360 })361 it('should eat everything after /', function(done){362 var app = express();363364 app.get('/user/:user*', function(req, res){365 res.end(req.params.user);366 });367368 request(app)369 .get('/user/122/aaa')370 .expect('122', done);371 })372 373 it('should span multiple segments', function(done){374 var app = express();375376 app.get('/file/*', function(req, res){
222 unmodified lines