X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FVariable-Magic.git;a=blobdiff_plain;f=t%2Flib%2FVariable%2FMagic%2FTestGlobalDestruction.pm;h=c6639a63ba3e2d8e3e6815d0dc604be7c096af54;hp=d610dc0a19fd2019157fb8dbac1c1ae33e663c66;hb=18975a85575a68ddb2e0e0a6ee8075dac66a3c73;hpb=7aa917c0209f40fa1593742b2cadeefe1d4f0922 diff --git a/t/lib/Variable/Magic/TestGlobalDestruction.pm b/t/lib/Variable/Magic/TestGlobalDestruction.pm index d610dc0..c6639a6 100644 --- a/t/lib/Variable/Magic/TestGlobalDestruction.pm +++ b/t/lib/Variable/Magic/TestGlobalDestruction.pm @@ -73,16 +73,23 @@ sub import { return 0; } - my $env_level = int($ENV{PERL_DESTRUCT_LEVEL} || 0); - if ($env_level >= $level) { - my $is_debugging = is_debugging_perl(); + my $env_level = $ENV{PERL_DESTRUCT_LEVEL}; + if (defined $env_level) { + $env_level = do { + no warnings 'numeric'; + int $env_level; + }; + my $is_debugging = is_debugging_perl(); if ($is_debugging) { - _diag("Global destruction level $env_level set by PERL_DESTRUCT_LEVEL (debugging perl)"); - return 1; + my $ignoring = $env_level < $level ? ', ignoring' : ''; + _diag("Global destruction level $env_level set by PERL_DESTRUCT_LEVEL (debugging perl)$ignoring"); + unless ($ignoring) { + return 1; + } + } else { + _diag("PERL_DESTRUCT_LEVEL is set to $env_level, but this perl doesn't seem to have debugging enabled, ignoring"); } - - _diag("PERL_DESTRUCT_LEVEL is set to $env_level, but this perl doesn't seem to have debugging enabled"); } my $has_perl_destruct_level = do {