Skip to content

Commit

Permalink
don't warn about variable used to keep document from going out of scope
Browse files Browse the repository at this point in the history
  • Loading branch information
moregan committed Mar 21, 2014
1 parent c889098 commit 7322e31
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions t/08_regression.t
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ BEGIN {
}

# For each new item in t/data/08_regression add another 15 tests
use Test::More tests => 933;
use Test::More tests => 932;
use Test::NoWarnings;
use File::Spec::Functions ':ALL';
use Params::Util qw{_INSTANCE};
use t::lib::PPI;
use PPI::Lexer;
use PPI::Dumper;
use PPI;

sub pause {
local $@;
Expand All @@ -46,11 +43,11 @@ t::lib::PPI->run_testdir(qw{ t data 08_regression });
# Regression Test for rt.cpan.org #11522

# Check that objects created in a foreach don't leak circulars.
is( scalar(keys(%PPI::Element::_PARENT)), 0, 'No parent links initially' );
foreach ( 1 .. 3 ) {
pause();
is( scalar(keys(%PPI::Element::_PARENT)), 0, 'No parent links at start of loop time' );
my $Document = PPI::Document->new(\q[print "Foo!"]);
is( scalar(keys(%PPI::Element::_PARENT)), 0, "No parent links at start of loop $_" );
# Keep the document from going out of scope before the _PARENT test below.
my $Document = PPI::Document->new(\q[print "Foo!"]); ## no critic ( Variables::ProhibitUnusedVarsStricter )
is( scalar(keys(%PPI::Element::_PARENT)), 4, 'Correct number of keys created' );
}

Expand Down

0 comments on commit 7322e31

Please sign in to comment.