Handel Coverage Is a Go

jk2addict on 2006-11-06T02:59:41

The reports can be found on the server.

That last 5% is painful. I didn't resort to too many tricks. I'm using Devel::Cover 0.59 on my laptop and on the server, and a version of 5.8.4 and 5.8.6. Somethings would cover on one version and not another, like

$foo ||= getstuff() || otherget() || '';


And the ever popular

my $class = ref $self || $self;


can't be covered in the 0/0 table without running them as functions instead of methods, which is totally pointless.

The only thing left is the mysterious eval lines in Handel::Base. In any case, it's a great starting point for 1.0. Just some Perl::Critic tings to wrap up, and it will be go time pretty soon.


eval is your friend.

Abigail on 2006-11-06T12:27:46

You could always write
    my $class = eval 'ref $self || $self';
if you worry about not getting 100% coverage.

Re:eval is your friend.

fireartist on 2006-11-06T14:48:39

And then when he runs `perlcritic`, he'll get a failure...

Expression form of "eval" at line 7, column 15. See page 161 of PBP. (Severity: 5)

...the joys of hacking code to pass tests meant to improve our code ;)

Re:eval is your friend.

Abigail on 2006-11-07T09:03:51

Reason #314 not to use perlcritic.

Re:eval is your friend.

DAxelrod on 2006-11-06T20:55:04

Eeewww, please don't! :)

I'd much rather you optimize for readability than obsessive 100% coverage.