Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Devel-Cover CPAN distribution.

Report information
The Basics
Id: 72027
Status: resolved
Priority: 0/
Queue: Devel-Cover

People
Owner: Nobody in particular
Requestors: jkeenan [...] cpan.org
RFREIMUTH [...] cpan.org
Cc: rrfreimuth2 [...] yahoo.com
AdminCc:

Bug Information
Severity: Important
Broken in: 0.79
Fixed in: (no value)



CC: rrfreimuth2 [...] yahoo.com
Subject: Devel::Cover does not detect branch coverage with DBM::Deep
Devel::Cover does not detect branch coverage when DBM::Deep is used. See the attached files, which contain short tests that demonstrate the bug. The two subroutines perform an if( exists )/else on a hashref. In one case the href is from DBM::Deep, in the other it is a regular unblessed hash. Running 'perl test_mod.t' verifies that both branches of both routines are exercised by the tests. Running 'prove' reports all 4 tests pass. Running 'cover' and examining the html report show that the 'if' branches of the routine that uses DBM::Deep have 0% coverage (a logical impossibility, as one branch will always be exercised) while the 'if' in the other routine has 100% coverage (both branches are exercised by the test). This behavior was observed with Devel::Cover 0.79 on Win XP. I regret I do not understand the code well enough to submit a patch. I hope the test cases are helpful. Thanks. This is perl, v5.10.1 built for MSWin32-x86-multi-thread (with 2 registered patches, see perl -V for more detail) Copyright 1987-2009, Larry Wall Binary build 1007 [291969] provided by ActiveState http://www.ActiveState.com Built Jan 26 2010 23:15:11
Subject: test_mod.t
use strict; use warnings; use Test::More; use Test::test_mod qw( testdbm testh ); is( testdbm( 1 ), 'dbm: exists', 'key exists in dbm' ); is( testdbm( 2 ), 'dbm: does not exist', 'key does not exist in dbm' ); is( testh( 1 ), 'h: exists', 'key exists in h' ); is( testh( 2 ), 'h: does not exist', 'key does not exist in h' ); done_testing();
Subject: test_mod.pm
package Test::test_mod; use strict; use warnings; use DBM::Deep; our @ISA = ( "Exporter" ); our @EXPORT_OK = qw( testdbm testh ); my $db = DBM::Deep->new( 'temp.db' ); $db->{1} = 1; my $h = { 1 => 1 }; sub testdbm { my ( $p ) = @_; if( exists $db->{$p} ) { return 'dbm: exists'; } else { return 'dbm: does not exist'; } } sub testh { my ( $p ) = @_; if( exists $h->{$p} ) { return 'h: exists'; } else { return 'h: does not exist'; } } 1;
Thank-you very much for this report. It has been fixed with commit b33679b which will be in the next release. Thanks again,
Subject: Re: [rt.cpan.org #72027] Resolved: Devel::Cover does not detect branch coverage with DBM::Deep
Date: Wed, 19 Sep 2012 19:37:33 -0700 (PDT)
To: bug-Devel-Cover [...] rt.cpan.org
From: Robert Freimuth <rrfreimuth2 [...] yahoo.com>
Thank you!! --- On Wed, 9/19/12, Paul Johnson via RT <bug-Devel-Cover@rt.cpan.org> wrote: Show quoted text
> From: Paul Johnson via RT <bug-Devel-Cover@rt.cpan.org> > Subject: [rt.cpan.org #72027] Resolved: Devel::Cover does not detect branch coverage with DBM::Deep > To: RFREIMUTH@cpan.org > Date: Wednesday, September 19, 2012, 8:08 PM > <URL: https://rt.cpan.org/Ticket/Display.html?id=72027 > > > According to our records, your request has been resolved. If > you have any > further questions or concerns, please respond to this > message. >
An additional comment accidentally re-opened this ticket. Am re-closing it. Thank you very much. Jim Keenan