Skip to content

Commit

Permalink
Handle run start time being undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
pjcj committed Sep 7, 2017
1 parent f054dc3 commit 39ee220
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/Devel/Cover/DB.pm
Original file line number Diff line number Diff line change
Expand Up @@ -788,8 +788,14 @@ sub cover {
my $cover = $self->{cover} = {};
my $uncoverable = {};
my $st = Devel::Cover::DB::Structure->new(base => $self->{base})->read_all;
my @runs = sort { $self->{runs}{$b}{start} <=> $self->{runs}{$a}{start} }
keys %{$self->{runs}};
# Sometimes the start value is undefined. It's not yet clear why, but it
# probably has something to do with the code under test forking. We'll
# just try to cope with that here.
my @runs = sort {
($self->{runs}{$b}{start} || 0) <=> ($self->{runs}{$a}{start} || 0)
||
$b cmp $a
} keys %{$self->{runs}};
# print STDERR "runs: ", Dumper \@runs

my %warned;
Expand Down

0 comments on commit 39ee220

Please sign in to comment.