Skip to content

Commit b080fb5

Browse files
committed
cloning a Match object, RT #88254
1 parent 606e737 commit b080fb5

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

S12-attributes/clone.t

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use v6;
22

33
use Test;
44

5-
plan 12;
5+
plan 14;
66

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

55+
# RT 88254
56+
{
57+
my ($p, $q);
58+
$p = 'a' ~~ /$<foo>='a'/;
59+
60+
# previously it was timeout on Rakudo
61+
lives_ok { $q = $p.clone }, 'Match object can be cloned';
62+
63+
is ~$q{'foo'}, 'a', 'cloned Match object retained named capture value';
64+
}
65+
5566
# vim: ft=perl6

0 commit comments

Comments
 (0)