File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 1
1
#import " DPLRegularExpression.h"
2
2
3
- static NSString * const DPLNamedGroupComponentPattern = @" :[a-zA-Z0-9-_][^/]+ " ;
3
+ static NSString * const DPLNamedGroupComponentPattern = @" :[a-zA-Z0-9-_]+ [^/]* " ;
4
4
static NSString * const DPLRouteParameterPattern = @" :[a-zA-Z0-9-_]+" ;
5
5
static NSString * const DPLURLParameterPattern = @" ([^/]+)" ;
6
6
Original file line number Diff line number Diff line change 40
40
DPLMatchResult *matchResult = [expression matchResultForString: @" /hello/dovalue/thisvalue/and/thatvalue" ];
41
41
expect (matchResult.match ).to .beFalsy ();
42
42
});
43
-
43
+
44
+ it (@" should match named components with single character" , ^{
45
+ DPLRegularExpression *expression = [DPLRegularExpression regularExpressionWithPattern: @" /hello/:a/:b/and/:c" ];
46
+
47
+ DPLMatchResult *matchResult = [expression matchResultForString: @" /hello/dovalue/thisvalue/and/thatvalue" ];
48
+ expect (matchResult.match ).to .beTruthy ();
49
+ expect (matchResult.namedProperties ).to .equal (@{ @" a" : @" dovalue" ,
50
+ @" b" : @" thisvalue" ,
51
+ @" c" : @" thatvalue" });
52
+ });
44
53
});
45
54
46
55
SpecEnd
You can’t perform that action at this time.
0 commit comments