Skip to content

Commit 9eef82d

Browse files
committed
Add some (failing?) edge cases
1 parent 90d4fb7 commit 9eef82d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

packages/route-pattern/src/lib/route-pattern.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,27 @@ describe('RoutePattern', () => {
420420
})
421421
})
422422

423+
it('handles arabic in URLs', () => {
424+
let pattern = new RoutePattern('users/:username')
425+
assert.deepEqual(pattern.match('https://example.com/users/مهدي'), {
426+
params: { username: 'مهدي' },
427+
})
428+
})
429+
430+
it('handles accents in URLs', () => {
431+
let pattern = new RoutePattern('users/:username')
432+
assert.deepEqual(pattern.match('https://example.com/users/sélim'), {
433+
params: { username: 'sélim' },
434+
})
435+
})
436+
437+
it('handles emojis in URLs', () => {
438+
let pattern = new RoutePattern('frameworks/:framework')
439+
assert.deepEqual(pattern.match('https://example.com/frameworks/💿'), {
440+
params: { framework: '💿' },
441+
})
442+
})
443+
423444
it('handles wildcards that look like paths', () => {
424445
let pattern = new RoutePattern('proxy/*url')
425446
assert.deepEqual(pattern.match('https://example.com/proxy/https://other.com/api')?.params, {

0 commit comments

Comments
 (0)