Branch Coverage

blib/lib/Business/UPC.pm
Criterion Covered Total %
branch 17 48 35.4


line true false branch
24 0 8 if length $value > 12
28 0 8 unless $number_system =~ /^\d$/
29 0 8 unless $mfr_id =~ /^\d{5}$/
30 0 8 unless $prod_id =~ /^\d{5}$/
31 0 8 unless $check_digit =~ /^[\dx]$/i
33 0 6 if $number_system == 0 and $mfr_id == 0 and $prod_id == 0
51 0 2 if length $value > 8
55 2 0 if $expanded
63 0 22 if @_
71 0 15 if @_
79 0 18 if @_
87 0 16 if @_
125 0 1 unless $self->is_coupon
132 0 1 unless $self->is_coupon
139 0 2 unless $self->is_coupon
175 0 0 if $upca =~ s/^0(\d{2})([012])0000(\d{3})(\d)$/0$1$3$2$4/
176 0 0 if $upca =~ s/^0(\d{2}[3-9])00000(\d{2})(\d)$/0$1$23$3/
177 0 0 if $upca =~ s/^0(\d{3}[1-9])00000(\d)(\d)$/0$1$24$3/
178 0 0 if $upca =~ s/^0(\d{4}[1-9])0000([5-9])(\d)$/0$1$2$3/
215 0 2 if length $upc_e > 8
217 2 0 if $upc_e =~ s/^0(\d{2})(\d{3})([012])([\dx])$/0$1$30000$2$4/i
218 0 0 if $upc_e =~ s/^0(\d{3})(\d{2})3([\dx])$/0$100000$2$3/i
219 0 0 if $upc_e =~ s/^0(\d{4})(\d)4([\dx])$/0$100000$2$3/i
220 0 0 if $upc_e =~ s/^0(.....)([5-9])([\dx])$/0$10000$2$3/i