@@ -25,6 +25,7 @@ is( "a\c[COMBINING DOT ABOVE, COMBINING DOT BELOW]b".comb,
25
25
26
26
27
27
# ?pugs skip "todo: Str.comb"
28
+ # ?rakudo skip '.comb with limit'
28
29
{
29
30
my Str $ hair = " Th3r3 4r3 s0m3 numb3rs 1n th1s str1ng" ;
30
31
is $ hair . comb (/\d + /), <3 3 4 3 0 3 3 1 1 1 >, ' no limit returns all matches' ;
@@ -50,6 +51,7 @@ is( "a\c[COMBINING DOT ABOVE, COMBINING DOT BELOW]b".comb,
50
51
}
51
52
52
53
# ?pugs todo 'feature'
54
+ # ?rakudo skip '.comb with limit'
53
55
is " a ab bc ad ba" . comb (/\S * a\S * /, 2 ), <a ab >, ' matcher and limit' ;
54
56
55
57
is " forty-two" . comb (). join (' |' ), ' f|o|r|t|y|-|t|w|o' , q { Str.comb(/./) } ;
@@ -67,13 +69,15 @@ is (<a ab>, <bc ad ba>).comb(m:Perl5/\S*a\S*/), <a ab ad ba>,
67
69
68
70
# needed: comb a filehandle
69
71
72
+ # ?rakudo skip 'nom'
70
73
{
71
74
my @ l = ' a23 b c58' . comb (/\w (\d + ) /);
72
75
is @ l . join (' |' ), ' a23|c58' , ' basic comb-without-matches sanity' ;
73
76
isa_ok(@ l [0 ], Str , ' first item is a Str' );
74
77
isa_ok(@ l [1 ], Str , ' second item is a Str' );
75
78
}
76
79
80
+ # ?rakudo skip 'nom'
77
81
{
78
82
my @ l = ' a23 b c58' . comb (/\w (\d + ) /, : match);
79
83
is @ l . join (' |' ), ' a23|c58' , ' basic comb-with-matches sanity' ;
@@ -87,6 +91,7 @@ is (<a ab>, <bc ad ba>).comb(m:Perl5/\S*a\S*/), <a ab ad ba>,
87
91
88
92
# RT #66340
89
93
# ?niecza skip 'Huh?'
94
+ # ?rakudo skip 'nom'
90
95
{
91
96
my $ expected_reason = rx /^ 'No applicable candidates ' /;
92
97
@@ -101,6 +106,7 @@ is (<a ab>, <bc ad ba>).comb(m:Perl5/\S*a\S*/), <a ab ad ba>,
101
106
ok " $!" ~~ $ expected_reason , ' .comb({...}) dies for the expected reason' ;
102
107
}
103
108
109
+ # ?rakudo skip 'nom'
104
110
{
105
111
is comb ( /. / , " abcd" ), <a b c d >, ' Subroutine form default limit' ;
106
112
is comb (/. / , " abcd" , 2 ), <a b >, ' Subroutine form with supplied limit' ;
0 commit comments