Skip to content

Commit

Permalink
cloning a Match object, RT #88254
Browse files Browse the repository at this point in the history
  • Loading branch information
bbkr committed Jul 15, 2012
1 parent 606e737 commit b080fb5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion S12-attributes/clone.t
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 12;
plan 14;

# L<S12/Cloning/You can clone an object, changing some of the attributes:>
class Foo {
Expand Down Expand Up @@ -52,4 +52,15 @@ is($val2, 42, '... cloned object has proper attr value');
}
}

# RT 88254
{
my ($p, $q);
$p = 'a' ~~ /$<foo>='a'/;

# previously it was timeout on Rakudo
lives_ok { $q = $p.clone }, 'Match object can be cloned';

is ~$q{'foo'}, 'a', 'cloned Match object retained named capture value';
}

# vim: ft=perl6

0 comments on commit b080fb5

Please sign in to comment.