Skip to content

Commit ba0fa5b

Browse files
committed
Add test to not match path against incomplete fixed rule
(This currently fails, as noted in #1.)
1 parent 1c30563 commit ba0fa5b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/tests.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ test("Multi-part fixed path", function () {
4545
router.run('items');
4646
});
4747

48+
test("Don't match fixed path against incomplete fixed rule", function () {
49+
var router = new PathParser;
50+
router.add('items', function () {
51+
throw new Error("Incorrect match");
52+
});
53+
notOk(router.run('items/top'));
54+
});
55+
4856
test("Ignore leading slash in URL", function () {
4957
expect(1);
5058
var router = new PathParser;

0 commit comments

Comments
 (0)