Skip to content

Commit 57f122d

Browse files
committed
test(parser): add more tests
1 parent 52f49c4 commit 57f122d

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

__tests__/matcher/path-ranking.spec.ts

+17-9
Original file line numberDiff line numberDiff line change
@@ -123,17 +123,16 @@ describe('Path ranking', () => {
123123
'/a/:b/c',
124124
'/a/:b',
125125
'/a',
126+
'/a-:b-:c',
127+
'/a-:b',
128+
'/a-:w(.*)',
129+
'/:a-:b-:c',
130+
'/:a-:b',
131+
'/:a-:b(.*)',
132+
'/:a/-:b',
126133
'/:a/:b',
127134
'/:w',
128135
'/:w+',
129-
// '/:a/-:b',
130-
// '/:a/:b',
131-
// '/a-:b',
132-
// '/a-:w(.*)',
133-
// '/:a-b',
134-
// '/:a-:b-:c',
135-
// '/:a-:b',
136-
// '/:a-:b(.*)',
137136
])
138137
})
139138

@@ -168,7 +167,8 @@ describe('Path ranking', () => {
168167
possibleOptions.forEach(options => {
169168
checkPathOrder(['/:w', ['/:w?', options]])
170169
checkPathOrder(['/:w?', ['/:w+', options]])
171-
checkPathOrder(['/:w?', ['/:w*', options]])
170+
checkPathOrder(['/:w+', ['/:w*', options]])
171+
checkPathOrder(['/:w+', ['/:w(.*)', options]])
172172
})
173173
})
174174

@@ -250,4 +250,12 @@ describe('Path ranking', () => {
250250
'/a/_:b(\\d)*-other',
251251
])
252252
})
253+
254+
it('ending slashes less than params', () => {
255+
checkPathOrder([
256+
['/a/b', { strict: false }],
257+
['/a/:b', { strict: true }],
258+
['/a/:b/', { strict: true }],
259+
])
260+
})
253261
})

0 commit comments

Comments
 (0)