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

Owner: Nobody in particular
Requestors: nodine [...]

Bug Information
Severity: Normal
Broken in: 0.63
Fixed in: (no value)

Subject: Condition coverage for constants
Download (untitled) / with headers
text/plain 275b
Condition coverage should ignore trying to get constants to resolve both true and false. For example, $dir = $user_dir || '.' is a common construct to use a user-specified directory and default to '.'. It is unreasonable, however, ever to expect '.' to evaluate false.
Download (untitled) / with headers
text/plain 373b
Thanks very much for your report. I believe that this is the the way that Devel::Cover works. So in your example, in order to get 100% coverage you would need to run two tests: one in which $user_dir was false, and the other in which is was true. If you have a specific example where this is not working properly please feel free to reopen this ticket. Thanks again,
Download (untitled) / with headers
text/plain 275b
In the example given, tests were run with $user_dir both true and false. Devel::Cover was saying that the second term in the "or" (after the "||") had never evaluated to false. However, being a constant, it has no ability to do so and should not count against the coverage.

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

Please report any issues with to