This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #128313] test for memory leak in POSIX classes
authorDan Collins <dcollinsn@gmail.com>
Wed, 8 Jun 2016 20:26:07 +0000 (16:26 -0400)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 13 Jun 2016 15:19:17 +0000 (08:19 -0700)
t/op/svleak.t

index 595bf3e..c18f498 100644 (file)
@@ -15,7 +15,7 @@ BEGIN {
 
 use Config;
 
-plan tests => 131;
+plan tests => 132;
 
 # run some code N times. If the number of SVs at the end of loop N is
 # greater than (N-1)*delta at the end of loop 1, we've got a leak
@@ -537,3 +537,13 @@ EOF
 
     ::leak(5, 0, \&f, q{goto shouldn't leak @_});
 }
+
+# [perl #128313] POSIX warnings shouldn't leak
+{
+    no warnings 'experimental';
+    use re 'strict';
+    my $a = 'aaa';
+    my $b = 'aa';
+    sub f { $a =~ /[^.]+$b/; }
+    ::leak(2, 0, \&f, q{use re 'strict' shouldn't leak warning strings});
+}