Branch Coverage

blib/lib/Basket/Calc.pm
Criterion Covered Total %
branch 32 54 59.2


line true false branch
56 0 8 unless (ref $item eq 'HASH')
62 0 8 unless (exists $$item{$key} and $$item{$key})
68 0 8 unless (looks_like_number($$item{'price'}))
74 4 4 if (exists $$item{'quantity'}) { }
75 0 4 if (not looks_like_number($$item{'quantity'}) or $$item{'quantity'} < 0)
87 6 2 unless exists $$item{'currency'} and $$item{'currency'}
91 2 6 if ($$item{'currency'} ne $self->currency)
96 0 2 unless ($amount)
112 0 8 if $self->debug
115 4 4 unless $self->items
125 0 2 unless (ref $discount eq 'HASH')
131 0 4 unless (exists $$discount{$key} and $$discount{$key})
137 0 2 unless ($$discount{'type'} =~ /^(percent|amount)$/x)
142 0 2 unless (looks_like_number($$discount{'value'}))
149 0 1 if ($$discount{'value'} <= 0 or $$discount{'value'} > 1)
155 1 0 unless exists $$discount{'currency'}
159 0 1 if ($$discount{'currency'} ne $self->currency)
163 0 0 unless ($amount)
181 0 2 if $self->debug
193 0 3 unless ($self->items)
205 0 3 if $self->debug
209 0 6 if $self->debug
217 2 1 if ($self->discount)
218 0 2 if $self->debug
227 0 1 if $$total{'net'} < 0
243 0 3 if $self->debug
264 4 8 if $float =~ /\.[0-9]{2}5/