Permalink
Browse files

add test for accessing match keys through scalary copy RT 62530

git-svn-id: http://svn.pugscode.org/pugs@26494 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent ed2cf32 commit 65a162322024990004bf952dbceb8686bd3b9d76 ron committed Apr 27, 2009
Showing with 11 additions and 1 deletion.
  1. +11 −1 S05-match/capturing-contexts.t
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 11;
+plan 13;
if !eval('("a" ~~ /a/)') {
skip_rest "skipped tests - rules support appears to be missing";
@@ -34,3 +34,13 @@ if !eval('("a" ~~ /a/)') {
ok( %($/).<alpha> eq 'a', 'hash context - named capture accessible');
ok( $/.hash.keys[0] eq 'alpha', 'the .hash method returns a hash object');
}
+
+# RT 62530
+{
+ class Match is also { method keys () {return %(self).keys }; };
+ rule a {H};
+ "Hello" ~~ /<a>/;
+ is $/.keys, 'a', 'get rule result';
+ my $x = $/;
+ is $x.keys, 'a', 'match copy should be same as match';
+}

0 comments on commit 65a1623

Please sign in to comment.