@@ -2539,6 +2539,11 @@ const MATCH_TESTS: MatchTestSet[] = [
2539
2539
{
2540
2540
path : "name{/:attr1}?{-:attr2}?{-:attr3}?" ,
2541
2541
tests : [
2542
+ {
2543
+ input : "name" ,
2544
+ matches : [ "name" , undefined , undefined , undefined ] ,
2545
+ expected : { path : "name" , index : 0 , params : { } } ,
2546
+ } ,
2542
2547
{
2543
2548
input : "name/test" ,
2544
2549
matches : [ "name/test" , "test" , undefined , undefined ] ,
@@ -2587,6 +2592,53 @@ const MATCH_TESTS: MatchTestSet[] = [
2587
2592
} ,
2588
2593
] ,
2589
2594
} ,
2595
+ {
2596
+ path : "name{/:attrs;-}*" ,
2597
+ tests : [
2598
+ {
2599
+ input : "name" ,
2600
+ matches : [ "name" , undefined ] ,
2601
+ expected : { path : "name" , index : 0 , params : { } } ,
2602
+ } ,
2603
+ {
2604
+ input : "name/1" ,
2605
+ matches : [ "name/1" , "1" ] ,
2606
+ expected : {
2607
+ path : "name/1" ,
2608
+ index : 0 ,
2609
+ params : { attrs : [ "1" ] } ,
2610
+ } ,
2611
+ } ,
2612
+ {
2613
+ input : "name/1-2" ,
2614
+ matches : [ "name/1-2" , "1-2" ] ,
2615
+ expected : {
2616
+ path : "name/1-2" ,
2617
+ index : 0 ,
2618
+ params : { attrs : [ "1" , "2" ] } ,
2619
+ } ,
2620
+ } ,
2621
+ {
2622
+ input : "name/1-2-3" ,
2623
+ matches : [ "name/1-2-3" , "1-2-3" ] ,
2624
+ expected : {
2625
+ path : "name/1-2-3" ,
2626
+ index : 0 ,
2627
+ params : { attrs : [ "1" , "2" , "3" ] } ,
2628
+ } ,
2629
+ } ,
2630
+ {
2631
+ input : "name/foo-bar/route" ,
2632
+ matches : null ,
2633
+ expected : false ,
2634
+ } ,
2635
+ {
2636
+ input : "name/test/route" ,
2637
+ matches : null ,
2638
+ expected : false ,
2639
+ } ,
2640
+ ] ,
2641
+ } ,
2590
2642
2591
2643
/**
2592
2644
* Nested parentheses.
0 commit comments