Permalink
Browse files

Cope with undef values for coverage.

And default to complete coverage if nothing is correctly specified.
  • Loading branch information...
1 parent d195a84 commit 35a0b2f0905417c0ff8e932c7eb64e682f9f9714 @pjcj committed Jul 13, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/Devel/Cover.pm
View
@@ -274,6 +274,7 @@ sub import
my $class = shift;
my @o = (@_, split ",", $ENV{DEVEL_COVER_OPTIONS} || "");
+ defined or $_ = "" for @o;
# print STDERR __PACKAGE__, ": Parsing options from [@o]\n";
my $blib = -d "blib";
@@ -354,7 +355,6 @@ sub import
$Criteria{$c} = $func->();
}
- %Coverage = (all => 1) unless keys %Coverage;
for (keys %Coverage)
{
my @c = split /-/, $_;
@@ -363,7 +363,9 @@ sub import
$Coverage{shift @c} = \@c;
delete $Coverage{$_};
}
+ delete $Coverage{$_} unless length;
}
+ %Coverage = (all => 1) unless keys %Coverage;
%Coverage_options = %Coverage;
$Initialised = 1;

0 comments on commit 35a0b2f

Please sign in to comment.