From: Eduardo San Martin Morote Date: Wed, 18 Dec 2019 09:09:53 +0000 (+0100) Subject: test(parser): add more tests X-Git-Tag: v4.0.0-alpha.0~135 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57f122de957cf60ce34216fece103db1f309e33a;p=thirdparty%2Fvuejs%2Frouter.git test(parser): add more tests --- 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 }], + ]) + }) })