support escaping param indicator in route paths
[squeep-api-dingus] / test / lib / router.js
index d63917087d1490021d5441564669008c60f1676c..f9a2401eba045bb3b0972acac39287a07a907a01 100644 (file)
@@ -46,6 +46,13 @@ describe('Router', function () {
       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 () {