From 11b3817fc4f802f5090a82f4c5253d1d3e969513 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 29 Oct 2026 10:14:54 +0000 Subject: [PATCH] test(router): pin a catch-all tail segment ending in `}` as literal A tail segment like `id}` reaches `toSegment`, whose param check needs a leading `{` as well as a trailing `}`; no test failed when the leading check was dropped, which made `id}` a param named `d`. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VVaw7Sutbw6xMTMyDFeNfw --- packages/router/tests/router.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/router/tests/router.test.ts b/packages/router/tests/router.test.ts index 3748e5c..708ad25 100644 --- a/packages/router/tests/router.test.ts +++ b/packages/router/tests/router.test.ts @@ -96,6 +96,7 @@ describe('Router', () => { '/{id', '/id}', '/id}/{x}', + '/f/{+p}/id}', ) for (const path of [ @@ -117,6 +118,8 @@ describe('Router', () => { expect(router.match('GET', '/anything')).toBeUndefined() expect(router.match('GET', '/x')).toBeUndefined() expect(router.match('GET', '/itemsfoo')).toBeUndefined() + expect(router.match('GET', '/f/1/id}')).toEqual({ data: '/f/{+p}/id}', params: { p: '1' } }) + expect(router.match('GET', '/f/1/id')).toBeUndefined() // only a whole-segment `{name}` is a param expect(router.match('GET', '/a/%7Bid%7D.json')).toEqual({