From 57f122de957cf60ce34216fece103db1f309e33a Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Wed, 18 Dec 2019 10:09:53 +0100 Subject: [PATCH] test(parser): add more tests --- __tests__/matcher/path-ranking.spec.ts | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/__tests__/matcher/path-ranking.spec.ts b/__tests__/matcher/path-ranking.spec.ts index d1beab9d..b8eddcda 100644 --- a/__tests__/matcher/path-ranking.spec.ts +++ b/__tests__/matcher/path-ranking.spec.ts @@ -123,17 +123,16 @@ describe('Path ranking', () => { '/a/:b/c', '/a/:b', '/a', + '/a-:b-:c', + '/a-:b', + '/a-:w(.*)', + '/:a-:b-:c', + '/:a-:b', + '/:a-:b(.*)', + '/:a/-:b', '/:a/:b', '/:w', '/:w+', - // '/:a/-:b', - // '/:a/:b', - // '/a-:b', - // '/a-:w(.*)', - // '/:a-b', - // '/:a-:b-:c', - // '/:a-:b', - // '/:a-:b(.*)', ]) }) @@ -168,7 +167,8 @@ describe('Path ranking', () => { possibleOptions.forEach(options => { checkPathOrder(['/:w', ['/:w?', options]]) checkPathOrder(['/:w?', ['/:w+', options]]) - checkPathOrder(['/:w?', ['/:w*', options]]) + checkPathOrder(['/:w+', ['/:w*', options]]) + checkPathOrder(['/:w+', ['/:w(.*)', options]]) }) }) @@ -250,4 +250,12 @@ describe('Path ranking', () => { '/a/_:b(\\d)*-other', ]) }) + + it('ending slashes less than params', () => { + checkPathOrder([ + ['/a/b', { strict: false }], + ['/a/:b', { strict: true }], + ['/a/:b/', { strict: true }], + ]) + }) }) -- 2.47.2