summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2011-12-08 16:27:33 +0000
committerDavid Mitchell <davem@iabyn.com>2011-12-19 15:06:07 +0000
commitf0cf90e542fc8d0b78f6f7bc2e201aad833eef6b (patch)
treee9060fd5f05704c047d4f01576c6e5fbd39cd40c
parent2977b3ed352c03d0aada0f1bb028533b6a872581 (diff)
downloadperl-f0cf90e542fc8d0b78f6f7bc2e201aad833eef6b.tar.gz
pat_re_eval.t: remove 'no warnings'
Now the the closure behaviour of code blocks within regexes is mostly fixes, remove the no warnings qw(uninitialized closure); that protected many of the closure tests. This also showed up that one of my recent tests didn't realise the whose test file is wrapped in a sub, so my test code destructor looked like sub run_tests { ... my $d; sub DESTRUCTOR { $d++ } ... } so fix that test to remove the closure warning.
-rw-r--r--t/re/pat_re_eval.t15
1 files changed, 6 insertions, 9 deletions
diff --git a/t/re/pat_re_eval.t b/t/re/pat_re_eval.t
index 3e094d5359..a498c9e46f 100644
--- a/t/re/pat_re_eval.t
+++ b/t/re/pat_re_eval.t
@@ -367,8 +367,6 @@ sub run_tests {
ok($_[0], $_[1]);
}
- # XXX remove this when TODOs are fixed
- no warnings qw(uninitialized closure);
# if the pattern string gets utf8 upgraded while concatenating,
# make sure a literal code block is still detected (by still
@@ -586,24 +584,23 @@ sub run_tests {
# and make sure things are freed at the right time
{
- package Foo99;
- my $d = 0;
- sub DESTROY { $d++ }
{
+ sub Foo99::DESTROY { $Foo99::d++ }
+ $Foo99::d = 0;
my $r1;
{
- my $x = bless [1];
+ my $x = bless [1], 'Foo99';
$r1 = eval 'qr/(??{$x->[0]})/';
}
my $r2 = eval 'qr/a$r1/';
my $x = 2;
- ::ok(eval '"a1" =~ qr/^$r2$/', "match while in scope");
+ ok(eval '"a1" =~ qr/^$r2$/', "match while in scope");
# make sure PL_reg_curpm isn't holding on to anything
"a" =~ /a(?{1})/;
- ::is($d, 0, "before scope exit");
+ is($Foo99::d, 0, "before scope exit");
}
- ::is($d, 1, "after scope exit");
+ ::is($Foo99::d, 1, "after scope exit");
}
# forward declared subs should Do The Right Thing with any anon CVs