Skip to content

Commit

Permalink
Fix "ignoring extra $criterion" errors.
Browse files Browse the repository at this point in the history
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
pjcj committed Aug 3, 2012
1 parent 870f2db commit 997426e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lib/Devel/Cover/DB/Structure.pm
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ sub set_subroutine
# print STDERR "new $file:$line:$sub_name\n"; # print STDERR "new $file:$line:$sub_name\n";
$self->{count}{$_}{$file} = $self->{count}{$_}{$file} =
$self->{f}{$file}{start}{$line}{$sub_name}[$scount]{$_} = $self->{f}{$file}{start}{$line}{$sub_name}[$scount]{$_} =
$self->get_count($_) $self->get_count($file, $_)
for $self->criteria; for $self->criteria;
} }
# print STDERR "set_subroutine start $file:$line $sub_name($scount) ", # print STDERR "set_subroutine start $file:$line $sub_name($scount) ",
Expand All @@ -186,7 +186,7 @@ sub store_counts
my ($file) = @_; my ($file) = @_;
$self->{count}{$_}{$file} = $self->{count}{$_}{$file} =
$self->{f}{$file}{start}{-1}{__COVER__}[0]{$_} = $self->{f}{$file}{start}{-1}{__COVER__}[0]{$_} =
$self->get_count($_) $self->get_count($file, $_)
for $self->criteria; for $self->criteria;
# print STDERR "store_counts: ", Dumper $self->{f}{$file}{start}; # print STDERR "store_counts: ", Dumper $self->{f}{$file}{start};
} }
Expand Down Expand Up @@ -241,9 +241,8 @@ sub digest
sub get_count sub get_count
{ {
my $self = shift; my $self = shift;
my ($criterion) = @_; my ($file, $criterion) = @_;
return 0 unless $self->{file}; # TODO - how does this get unset? $self->{count}{$criterion}{$file}
$self->{count}{$criterion}{$self->{file}}
} }


sub add_count sub add_count
Expand Down

0 comments on commit 997426e

Please sign in to comment.