You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#!/usr/bin/perl
use strict;
use warnings;
use Test::More;
use Test::FailWarnings;
{
my $thing = bless [], 'LeakDetector';
is( $thing, $thing, 'I am I' );
}
done_testing;
# ----------------------------------------------------------------------
package LeakDetector;
sub DESTROY {
warn "DESTROY at global destruction!\n" if ${^GLOBAL_PHASE} eq 'DESTRUCT';
}
If you run the above under Devel::Cover we see something like:
> perl -MDevel::Cover ref_bug.t
Devel::Cover 1.36: Collecting coverage data for branch, condition, pod, statement, subroutine and time.
Selecting packages matching:
Ignoring packages matching:
/Devel/Cover[./]
Ignoring packages in:
/Users/felipe/perl5/lib/perl5/darwin-thread-multi-2level
/Users/felipe/perl5/lib/perl5
/opt/local/lib/perl5/site_perl/5.28/darwin-thread-multi-2level
/opt/local/lib/perl5/site_perl/5.28
/opt/local/lib/perl5/vendor_perl/5.28/darwin-thread-multi-2level
/opt/local/lib/perl5/vendor_perl/5.28
/opt/local/lib/perl5/5.28/darwin-thread-multi-2level
/opt/local/lib/perl5/5.28
ok 1 - I am I
1..1
Devel::Cover: Deleting old coverage for changed file ref_bug.t
Devel::Cover: getting BEGIN block coverage
Devel::Cover: 100% - 0s taken
Devel::Cover: getting CHECK block coverage
Devel::Cover: 100% - 0s taken
Devel::Cover: getting END/INIT block coverage
Devel::Cover: 100% - 0s taken
Devel::Cover: getting CV coverage
Devel::Cover: 100% - 0s taken
Devel::Cover: Writing coverage database to /Users/felipe/code/Devel--Cover/cover_db/runs/1654521279.80674.37036
--------- ------ ------ ------ ------ ------ ------ ------
File stmt bran cond sub pod time total
--------- ------ ------ ------ ------ ------ ------ ------
ref_bug.t 94.4 0.0 n/a 80.0 n/a 100.0 84.0
Total 94.4 0.0 n/a 80.0 n/a 100.0 84.0
--------- ------ ------ ------ ------ ------ ------ ------
Use of uninitialized value $hid in hash element at /Users/felipe/perl5/lib/perl5/Test2/API.pm line 396 during global destruction.
Use of uninitialized value $hid in hash element at /Users/felipe/perl5/lib/perl5/Test2/API.pm line 492 during global destruction.
Use of uninitialized value $hid in hash element at /Users/felipe/perl5/lib/perl5/Test2/API.pm line 493 during global destruction.
Use of uninitialized value in array element at /Users/felipe/perl5/lib/perl5/Test/Builder.pm line 706 during global destruction.
(in cleanup) (in cleanup) at /Users/felipe/perl5/lib/perl5/Test/Builder.pm line 729 during global destruction.
(in cleanup) (in cleanup) at /Users/felipe/perl5/lib/perl5/Test2/API/Context.pm line 73 during global destruction.
The text was updated successfully, but these errors were encountered:
If you run the above under Devel::Cover we see something like:
The text was updated successfully, but these errors were encountered: