Permalink
Browse files

[t/spec] tests for RT #RT #77160, flattening of quantified captures i…

…n Match objects

git-svn-id: http://svn.pugscode.org/pugs@31962 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent 6c8c48d commit b5caf94f141e1074d27bbb06564634eb4d329fe7 moritz committed Aug 12, 2010
Showing with 14 additions and 1 deletion.
  1. +14 −1 S05-match/capturing-contexts.t
@@ -111,10 +111,23 @@ is_run( q{'aa' ~~ /(.)$1/},
$/ = Any;
lives_ok { $0 },
'$0 accessible when $/ is undefined';
- isa_ok $0, Any,
+ ok $0 === Any,
'$0 is Any when $/ is undefined';
}
+# RT #77160
+{
+ ok 'abc' ~~ /(.)+/, 'regex sanity';
+ my $x = 0;
+ $x++ for $/.list;
+ is $x, 1, '$/.list does not flatten quantified subcaptures';
+
+ ok 'abc' ~~ /(.)**2 (.)/, 'regex sanity';
+ $x = 0;
+ $x++ for $/.list;
+ is $x, 2, '$/.list does not flattens subcaptures';
+}
+
done_testing;
# vim: ft=perl6

0 comments on commit b5caf94

Please sign in to comment.