Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix "ignoring extra $criterion" errors.

This is a very old bug that had been perplexing me for years.  Of course, the
solution is trivial, but tracking it down involved hours of debugging using
some rather convoluted code.

Thanks, TPF, for affording me the opportunity find and fix this.
  • Loading branch information...
commit 997426eecb16899d0be425853478e2b5bdf9a1ee 1 parent 870f2db
Paul Johnson authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 lib/Devel/Cover/DB/Structure.pm
9 lib/Devel/Cover/DB/Structure.pm
View
@@ -173,7 +173,7 @@ sub set_subroutine
# print STDERR "new $file:$line:$sub_name\n";
$self->{count}{$_}{$file} =
$self->{f}{$file}{start}{$line}{$sub_name}[$scount]{$_} =
- $self->get_count($_)
+ $self->get_count($file, $_)
for $self->criteria;
}
# print STDERR "set_subroutine start $file:$line $sub_name($scount) ",
@@ -186,7 +186,7 @@ sub store_counts
my ($file) = @_;
$self->{count}{$_}{$file} =
$self->{f}{$file}{start}{-1}{__COVER__}[0]{$_} =
- $self->get_count($_)
+ $self->get_count($file, $_)
for $self->criteria;
# print STDERR "store_counts: ", Dumper $self->{f}{$file}{start};
}
@@ -241,9 +241,8 @@ sub digest
sub get_count
{
my $self = shift;
- my ($criterion) = @_;
- return 0 unless $self->{file}; # TODO - how does this get unset?
- $self->{count}{$criterion}{$self->{file}}
+ my ($file, $criterion) = @_;
+ $self->{count}{$criterion}{$file}
}
sub add_count
Please sign in to comment.
Something went wrong with that request. Please try again.