Branch Coverage

blib/lib/Nitesi/Cart.pm
Criterion Covered Total %
branch 56 76 73.6


line true false branch
62 0 6 if ($args{'name'}) { }
70 1 11 if (exists $args{$ts})
75 0 6 if ($args{'modifiers'})
79 2 4 if ($args{'run_hooks'})
124 3 4 if ($$self{'cache_subtotal'})
149 1 7 if ($$self{'cache_total'})
208 12 0 if (ref $_[0]) { }
220 0 11 unless (exists $item{'sku'} and defined $item{'sku'} and $item{'sku'} =~ /\S/)
225 0 10 unless (exists $item{'name'} and defined $item{'name'} and $item{'name'} =~ /\S/)
230 3 7 if (exists $item{'quantity'} and defined $item{'quantity'}) { }
231 0 3 unless ($item{'quantity'} =~ /^(\d+)$/ and $item{'quantity'} > 0)
240 0 9 unless (exists $item{'price'} and defined $item{'price'} and $item{'price'} =~ /^(\d+)(\.\d+)?$/ and $item{'price'} > 0)
249 1 8 if (exists $item{'error'})
258 7 1 unless ($ret = $self->_combine(\%item))
285 3 1 if ($$item{'sku'} eq $arg)
292 3 0 if ($found)
298 1 2 if (exists $$item{'error'})
347 0 4 unless ($item = $self->find($sku))
351 1 3 if ($qty == 0)
358 1 2 if $qty == $$item{'quantity'}
365 0 2 if (exists $$new_item{'error'})
422 4 1 if ($sku eq $$cartitem{'sku'})
517 3 1 unless ($args{'inclusive'})
559 6 0 if (defined $loc)
560 3 3 if ($loc =~ /^\d+/) { }
3 0 elsif ($loc =~ /\S/) { }
567 3 0 if ($$c{'name'} eq $loc)
574 6 0 if (defined $cost)
591 0 0 if (@_ > 0)
607 1 1 if (@_ > 0)
650 0 1 unless $item_ref
664 1 3 if ($$item{'sku'} eq $$cartitem{'sku'})
666 0 0 unless $$item{$mod} eq $$cartitem{$mod}
683 6 7 if (ref $costs eq 'HASH') { }
0 7 elsif (ref $costs eq 'ARRAY') { }
696 1 9 if ($$calc{'inclusive'} and not $display)
700 6 3 if ($$calc{'relative'}) { }
715 21 26 if ($$self{'run_hooks'})