Branch Coverage

blib/lib/Business/UPC.pm
Criterion Covered Total %
branch 23 48 47.9


line true false branch
17 0 54 if length $value > 12
21 0 54 unless $number_system =~ /^\d$/
22 0 54 unless $mfr_id =~ /^\d{5}$/
23 0 54 unless $prod_id =~ /^\d{5}$/
24 0 54 unless $check_digit =~ /^[\dx]$/i
26 0 50 if $number_system == 0 and $mfr_id == 0 and $prod_id == 0
44 0 13 if length $value > 8
48 13 0 if $expanded
56 0 69 if @_
64 0 62 if @_
72 0 65 if @_
80 0 63 if @_
117 0 1 unless $self->is_coupon
124 0 1 unless $self->is_coupon
131 0 2 unless $self->is_coupon
167 0 0 if $upca =~ s/^0(\d{2})([012])0000(\d{3})(\d)$/0$1$3$2$4/
168 0 0 if $upca =~ s/^0(\d{2}[3-9])00000(\d{2})(\d)$/0$1$23$3/
169 0 0 if $upca =~ s/^0(\d{3}[1-9])00000(\d)(\d)$/0$1$24$3/
170 0 0 if $upca =~ s/^0(\d{4}[1-9])0000([5-9])(\d)$/0$1$2$3/
207 0 13 if length $upc_e > 8
209 5 8 if $upc_e =~ s/^0(\d{2})(\d{3})([012])([\dx])$/0$1$30000$2$4/i
210 1 7 if $upc_e =~ s/^0(\d{3})(\d{2})3([\dx])$/0$100000$2$3/i
211 1 6 if $upc_e =~ s/^0(\d{4})(\d)4([\dx])$/0$100000$2$3/i
212 6 0 if $upc_e =~ s/^0(.....)([5-9])([\dx])$/0$10000$2$3/i