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: 78801
Status: new
Priority: 0/
Queue: Devel-Cover

People
Owner: Nobody in particular
Requestors: mhasch-cpanbugs [...] cozap.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in:
  • 0.92
  • 0.93
  • 1.17
  • 1.18
Fixed in: (no value)



Subject: condition coverage gets messed up by de Morgan rule
Download (untitled) / with headers
text/plain 664b
The perl parser apparently simplifies some conditions using de Morgan's rule. In such cases, Devel::Cover fails to count all combinations of subconditions correctly. In my example, there is a statement: return 1 if !$a and !$b; The condition here is shown in condition coverage reports as ``$a or $b'', which suggests that de Morgan's rule has been applied. The case $a false and $b true, however, will wrongly be counted as $a false and $b false in this context, leading to wrong accusations of insufficient coverage. The problem goes away when the statement is written as: return 1 unless $a or $b; I checked this with Devel-Cover-0.92 and 0.93. -Martin
Subject: Foo.pm
Download Foo.pm
text/x-perl 97b
package Foo; sub Foobar { my ($a, $b) = @_; return 1 if !$a && !$b; return 2; } 1;
Subject: Foo.t
Download Foo.t
text/x-perl 167b
use strict; use warnings; use Foo; use Test::More tests => 4; is(Foo::Foobar(1, 1), 2); is(Foo::Foobar(1, 0), 2); is(Foo::Foobar(0, 1), 2); is(Foo::Foobar(0, 0), 1);


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.