Commit | Line | Data |
49c38585 |
1 | #!./perl -w |
2 | |
3 | BEGIN { |
4 | chdir 't' if -d 't'; |
5 | @INC = '../lib'; |
6 | require './test.pl'; |
b75281af |
7 | undef &Regexp::DESTROY; |
49c38585 |
8 | } |
9 | |
10 | plan tests => 2; |
11 | |
12 | $TODO = "leaking since 32751"; |
13 | |
14 | my $destroyed; |
15 | { |
49c38585 |
16 | sub Regexp::DESTROY { $destroyed++ } |
17 | } |
18 | |
19 | { |
20 | my $rx = qr//; |
21 | } |
22 | |
23 | is( $destroyed, 1, "destroyed regexp" ); |
24 | |
25 | undef $destroyed; |
26 | |
27 | { |
28 | my $var = bless {}, "Foo"; |
29 | my $rx = qr/(?{ $var })/; |
30 | } |
31 | |
32 | is( $destroyed, 1, "destroyed regexp with closure capture" ); |
33 | |