Permalink
Browse files

Start adding tests for quantified captures.

  • Loading branch information...
1 parent 66ea32d commit 54a9a074d1b48d9919a87b3537d2ecd7470c6dad @pmichaud pmichaud committed Apr 29, 2013
Showing with 5 additions and 2 deletions.
  1. +4 −2 src/QRegex/Cursor.nqp
  2. +1 −0 t/qregex/01-qregex.t
View
@@ -688,14 +688,16 @@ class NQPMatch is NQPCapture {
if $item ~~ NQPCapture {
$str := $str ~ $item."!dump_str"($key)
}
- elsif !nqp::isnull($item) {
+ elsif nqp::islist($item) {
+ $str := $str ~ "$key: list\n";
my $n := 0;
for $item { $str := $str ~ dump_array($key ~ "[$n]", $_); $n++ }
}
$str;
}
my $str := $key ~ ': ' ~ nqp::escape(self.Str) ~ ' @ ' ~ self.from ~ "\n";
- $str := $str ~ dump_array($key, self.list);
+ my $n := 0;
+ for self.list { $str := $str ~ dump_array($key ~ '[' ~ $n ~ ']', $_); $n++ }
for self.hash { $str := $str ~ dump_array($key ~ '<' ~ $_.key ~ '>', $_.value); }
$str;
}
View
@@ -5,6 +5,7 @@ use QRegex;
my @files := [
'rx_captures',
+ 'rx_qcaps',
'rx_basic',
'rx_quantifiers',
'rx_metachars',

0 comments on commit 54a9a07

Please sign in to comment.