Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit 65a162322024990004bf952dbceb8686bd3b9d76 1 parent ed2cf32
ron authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 S05-match/capturing-contexts.t
View
12 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';
+}
Please sign in to comment.
Something went wrong with that request. Please try again.