Branch Coverage

blib/lib/Imager/Expr.pm
Criterion Covered Total %
branch 63 96 65.6


line true false branch
13 0 0 if UNIVERSAL::isa($_[0], "Imager::Expr")
14 0 0 if (@_) { }
34 0 31 unless defined $type
38 0 31 unless $opts->{'constants'}
39 0 31 unless $self->{'ops'} = $self->compile($opts->{$type}, $opts)
41 0 31 unless $self->optimize
43 0 31 unless $self->{'code'} = $self->assemble
88 1 30 if grep(($_->[0] =~ /^jump/), @ops)
104 0 188 if ($seen{$desc})
110 0 0 if $reg eq $old
124 12 1 if ($op->[0] eq "div" and $op->[2] =~ /^r(\d+)/ and defined $self->{'nregs'}[$1])
166 146 216 if (/^$numre$/) { }
20 196 elsif (exists $vars{$_}) { }
154 42 elsif (exists $attr->{$_} and length $attr->{$_}{'types'}) { }
13 29 elsif (/^!(\w+)$/) { }
29 0 elsif (/^\@(\w+)$/) { }
168 64 82 if (exists $nregs{$_}) { }
181 0 154 if (@regstack < $attr->{$_}{'parms'})
187 6 148 if ($types ne $attr->{$_}{'types'})
188 6 0 if (exists $$attr{$_ . 'p'} and $types eq $$attr{$_ . 'p'}{'types'}) { }
197 104 50 if ($attr->{$_}{'result'} eq 'r') { }
211 0 13 unless (@regstack)
218 29 0 if (exists $names{$1}) { }
231 0 29 if (@regstack != 1)
235 0 29 unless ($regstack[0] =~ /^p/)
268 15 0 if ($name) { }
274 23 3 if ($parm eq "r")
275 6 17 if ($reg < @vars) { }
9 8 elsif (defined $self->{'nregs'}[$reg]) { }
285 11 4 if $attr->{$name}{'result'}
312 54 308 if exists $op_names{$_}
313 14 348 if exists $self->{'constants'}{$_}
413 0 0 if (not $parser)
420 1 0 unless ($parser)
424 0 1 unless ($optree)
440 0 1 if (exists $self->{'inputs'}{$varname})
449 0 1 unless ($result =~ /^p\d+$/)
455 0 1 if ($@)
466 4 7 if (ref $tree) { }
3 4 elsif (exists $self->{'varregs'}{$tree}) { }
4 0 elsif ($tree =~ /^$numre$/ or exists $self->{'constants'}{$tree}) { }
469 0 4 unless (exists $Imager::Expr::Infix::Attr{$op})
478 0 4 if (length $types < length $Imager::Expr::Infix::Attr{$op}{'types'})
481 0 4 if ($types ne $Imager::Expr::Infix::Attr{$op}{'types'})
484 0 0 if (exists $Imager::Expr::Infix::Attr{$opp} and $types eq $Imager::Expr::Infix::Attr{$opp}{'types'}) { }
493 3 1 if ($Imager::Expr::Infix::Attr{$op}{'result'} eq 'r') { }
509 2 2 if exists $self->{'constants'}{$tree}
511 1 3 if (exists $self->{'lits'}{$tree})