Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
re-add capture tests
  • Loading branch information
TimToady committed Dec 13, 2014
1 parent 9990bba commit 8bca161
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions S05-modifier/overlapping.t
Expand Up @@ -10,7 +10,7 @@ It probably needs a few syntax updates to remove p5isms
=end pod

plan 20;
plan 22;

# should be: L<S05/Modifiers/With the new C<:ov> (C<:overlap>) modifier,>
# L<S05/Modifiers/match at all possible character positions>
Expand All @@ -25,14 +25,15 @@ my @expected = (
);

{
for (1..2) -> $rep {
ok($str ~~ m:i:overlap/ a .+ a /, "Repeatable overlapping match ($rep)" );
for 1..2 -> $rep {
ok($str ~~ m:i:overlap/ a (.+) a /, "Repeatable overlapping match ($rep)" );

ok(@$/ == @expected, "Correct number of matches ($rep)" );
my @expected_pos = @expected.map: { $_[0] };
my @expected_str = @expected.map: { $_[1] };
is $/.list.join('|'), @expected_str.join('|'), 'Got right submatches';
is $/.list.map(*.from), @expected_pos, 'Got right position of submatches';
is $/.list»[0].join('|'), @expected_str.map(*.substr(1,*-1)).join('|'), 'Got captures';
}
}

Expand Down

0 comments on commit 8bca161

Please sign in to comment.