Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Fix array-regex interpolation, enable more tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmichaud committed May 24, 2010
1 parent 1b1fe32 commit 3e805c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Regex/Cursor.pir
Expand Up @@ -760,7 +760,7 @@ and the longest match is returned.
array_sub:
$P0 = elem(self)
unless $P0 goto array_loop
$I0 = $P0.'to'()
$I0 = $P0.'pos'()
$I0 -= pos
if $I0 <= maxlen goto array_loop
maxlen = $I0
Expand Down
4 changes: 2 additions & 2 deletions t/nqp/49-regex-interpolation.t
Expand Up @@ -23,13 +23,13 @@ ok(("abccd" ~~ / @ltm /) eq 'bc', 'array finds longest match 4');
ok(!("ab+d" ~~ /a <$b> d/), 'scalar assertion interpolates as regex 1');
ok("abbbbbd" ~~ /a <$b> d/, 'scalar assertion interpolates as regex 2');

=begin END
ok(!("ab+d" ~~ /a <@foo> d/), 'array assertion interpolates as alternations of regexen 1');
ok(!("ac+d" ~~ /a <@foo> d/), 'array assertion interpolates as alternations of regexen 2');
ok("abbbbbd" ~~ /a <@foo> d/, 'array assertion interpolates as alternations of regexen 3');
ok("acccccd" ~~ /a <@foo> d/, 'array assertion interpolates as alternations of regexen 4');

=begin END
ok(!("ab+d" ~~ /a <{ "b+" }> d/), 'code assersion interpolates as regex 1');
ok("abbbbd" ~~ /a <{ "b+" }> d/, 'code assersion interpolates as regex 2');
Expand Down

0 comments on commit 3e805c7

Please sign in to comment.