On Mon Oct 22 16:54:27 2012, SREZIC wrote:
Show quoted text> Devel::Cover does not have coverage statistics for a foreach block if a
> continue block is following. See the attached script. If I remove the
> "my $x" in the test script (and replace $x by $_), then there are
> coverage statistics for the block. In both cases there's no coverage for
> the continue block.
>
> I tested this with perl 5.12.4 on FreeBSD 9.0, using the cmdline
>
> /usr/perl5.12.4/bin/perl -MDevel::Cover simple.pl ;
> /usr/perl5.12.4/bin/cover
>
> Regards,
> Slaven
Using Perl 5.16.0 and Devel::Cover 1.0, I was unable to reproduce this problem.
I downloaded your file, renaming it as 80340_simple.pl. I then ran the following and got the output displayed:
##########
$ perl -MDevel::Cover 80340_simple.pl
Devel::Cover 1.00: Collecting coverage data for branch, condition, pod, statement, subroutine and time.
Selecting packages matching:
Ignoring packages matching:
/Devel/Cover[./]
Ignoring packages in:
/usr/local/lib/perl5/site_perl/5.16.0/darwin-2level
/usr/local/lib/perl5/site_perl/5.16.0
/usr/local/lib/perl5/5.16.0/darwin-2level
/usr/local/lib/perl5/5.16.0
/usr/local/lib/perl5/site_perl/5.14.2
/usr/local/lib/perl5/site_perl/5.14.0
/usr/local/lib/perl5/site_perl/5.12.0
/usr/local/lib/perl5/site_perl/5.10.1
/usr/local/lib/perl5/site_perl/5.10.0
/usr/local/lib/perl5/site_perl
ok 1
ok 2
1..2
Devel::Cover: Writing coverage database to /Users/jimk/Documents/AAAPerl/Devel-Cover/80340/cover_db/runs/1365765976.464.42338
---------------------------- ------ ------ ------ ------ ------ ------ ------
File stmt bran cond sub pod time total
---------------------------- ------ ------ ------ ------ ------ ------ ------
80340_simple.pl 100.0 n/a n/a 100.0 n/a 100.0 100.0
Total 100.0 n/a n/a 100.0 n/a 100.0 100.0
---------------------------- ------ ------ ------ ------ ------ ------ ------
$ cover -report=text > 80340_coverage.txt
I am attaching 80340_coverage.txt. Note that all statements are covered, including those in the 'foreach' block before the 'continue' block.
I recommend this ticket be closed.
Thank you very much.
Jim Keenan