Skip to content

Commit 943c907

Browse files
committed
Add test cases from #95
1 parent 1327699 commit 943c907

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

src/index.spec.ts

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2557,11 +2557,11 @@ const TESTS: Test[] = [
25572557
* Nested parenthesis.
25582558
*/
25592559
[
2560-
"/:foo(\\d+(?:\\.\\d+)?)",
2561-
{},
2560+
"/:test(\\d+(?:\\.\\d+)?)",
2561+
undefined,
25622562
[
25632563
{
2564-
name: "foo",
2564+
name: "test",
25652565
prefix: "/",
25662566
delimiter: "/",
25672567
optional: false,
@@ -2571,12 +2571,18 @@ const TESTS: Test[] = [
25712571
],
25722572
[
25732573
["/123", ["/123", "123"]],
2574-
["/123.123", ["/123.123", "123.123"]]
2574+
["/abc", null],
2575+
["/123/abc", null],
2576+
["/123.123", ["/123.123", "123.123"]],
2577+
["/123.abc", null]
25752578
],
25762579
[
2577-
[{ foo: 123 }, "/123"],
2578-
[{ foo: 123.123 }, "/123.123"],
2579-
[{ foo: "123" }, "/123"]
2580+
[{ test: 123 }, "/123"],
2581+
[{ test: 123.123 }, "/123.123"],
2582+
[{ test: "abc" }, null],
2583+
[{ test: "123" }, "/123"],
2584+
[{ test: "123.123" }, "/123.123"],
2585+
[{ test: "123.abc" }, null]
25802586
]
25812587
]
25822588
];

0 commit comments

Comments
 (0)