const r = router._pathToRoutePath(p);
assert.deepStrictEqual(r, expected);
});
+ it('defines a path with escaped parameter', function () {
+ const p = '/a/\\:b/c';
+ const expected = ['', 'a', ':b', 'c'];
+ expected[Router.kPathMethods] = {};
+ const r = router._pathToRoutePath(p);
+ assert.deepStrictEqual(r, expected);
+ });
}); // _pathToRoutePath
describe('_pathCompareExact', function () {
const { handler } = router.lookup(method, path, ctx);
assert.strictEqual(handler, stubHandler);
+ assert.strictEqual(ctx.matchedPath, urlPath);
});
it('does not find handler with trailing slash', function () {
router.ignoreTrailingSlash = false;