summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-11-02 20:06:08 -0700
committerFather Chrysostomos <sprout@cpan.org>2010-11-02 21:32:34 -0700
commit4eedab498fc909c786cceea9a6f3a70fa4433f9b (patch)
treefb6b39f16dd28ea5e169514fc8d9e20bc86234d3 /t
parent8db9069ca0bb3b524c2f656356fc526984285a58 (diff)
downloadperl-4eedab498fc909c786cceea9a6f3a70fa4433f9b.tar.gz
s///r leaks like a sieve
Diffstat (limited to 't')
-rw-r--r--t/re/subst.t7
1 files changed, 6 insertions, 1 deletions
diff --git a/t/re/subst.t b/t/re/subst.t
index cb43510d31..8ea53a2f4a 100644
--- a/t/re/subst.t
+++ b/t/re/subst.t
@@ -7,7 +7,7 @@ BEGIN {
}
require './test.pl';
-plan( tests => 172 );
+plan( tests => 174 );
# Stolen from re/ReTest.pl. Can't just use the file since it doesn't support
# like() and it conflicts with test.pl
@@ -88,6 +88,11 @@ ok( defined tied($m), 's///r magic isn\'t lost' );
$b = $m =~ s/xxx/yyy/r;
ok( ! defined tied($b), 's///r magic isn\'t contagious' );
+my $ref = \("aaa" =~ s/aaa/bbb/r);
+is (Internals::SvREFCNT($$ref), 1, 's///r does not leak');
+$ref = \("aaa" =~ s/aaa/bbb/rg);
+is (Internals::SvREFCNT($$ref), 1, 's///rg does not leak');
+
$x = 'foo';
$_ = "x";
s/x/\$x/;