Branch Coverage

blib/lib/Spreadsheet/XLSX/Reader/LibXML/ParseExcelFormatStrings.pm
Criterion Covered Total %
branch 325 408 79.6


line true false branch
131 0 0 unless (defined $coercion_string)
138 0 0 unless ($coercion)
154 0 50 unless (defined $format_strings)
165 50 0 if ($self->get_cache_behavior)
170 1 49 if ($self->_has_cached_format($cache_key)) { }
183 8 41 $format_string_list[-1] =~ /\@/ ? :
188 8 6 scalar(@format_string_list) - $last_is_text == 2 ? :
35 14 scalar(@format_string_list) - $last_is_text == 1 ? :
236 99 99 if ($fixed_value)
237 2 97 if ($fixed_value =~ /\[\$([^\-\]]*)\-?\d*\]/) { }
4 93 elsif ($fixed_value =~ /\[[^hms]*\]/) { }
2 180 elsif ($fixed_value =~ /\"\-\"/ and $format_string) { }
249 162 36 if (defined $pre_action) { }
250 8 0 $text ? :
107 8 defined $number ? :
47 115 $date ? :
254 47 115 if $date
258 20 93 if ($action_type and $current_action and $current_action ne $action_type)
263 4 16 if ($action_type eq 'DATE') { }
4 12 elsif ($action_type eq 'NUMBER') { }
12 0 elsif ($action_type eq 'INTEGER' or $action_type eq 'DECIMAL') { }
267 2 2 if ($current_action eq 'NUMBER') { }
2 0 elsif ($pre_action eq '@') { }
270 2 0 if ($pre_action =~ /^\.$/ and $format_string =~ /^0+/ or $pre_action =~ /^0+$/ and $deconstructed_list[-1][0] =~ /^\.$/)
284 4 0 if ($current_action eq 'TEXT')
292 12 0 if ($current_action eq 'NUMBER')
298 0 20 if ($fail)
302 162 0 if $current_action
313 0 198 if ($x++ == 30)
321 71 127 if length $format_string == 0
323 0 71 if $format_string
326 47 24 $action_type =~ /^(NUMBER|SCIENTIFIC|INTEGER|PERCENT|FRACTION|DECIMAL)$/ ? :
328 6 65 $action_type && $action_type eq 'TEXT' ? :
329 2 69 if ($action_type and $action_type eq 'DATESTRING')
339 65 6 $intermediate_action =~ /^(NUMBER|SCIENTIFIC|INTEGER|PERCENT|FRACTION|DECIMAL|DATE|DATESTRING)$/ ? :
342 14 35 if ($is_date and not $date_text)
345 14 0 $intermediate_action =~ /^(NUMBER|SCIENTIFIC|INTEGER|PERCENT|FRACTION|DECIMAL|DATE|DATESTRING)$/ ? :
355 6 43 if $action_type eq 'TEXT'
356 0 49 if $coercion_name
371 49 0 if ($self->get_cache_behavior)
408 6 0 if (not $found_string and defined $piece->[0])
412 0 6 if ($piece->[1])
441 15 1 unless ($self->get_date_behavior)
447 46 2 if (defined $piece->[0])
450 1 45 if ($piece->[0] =~ /\[(.+)\]/) { }
2 43 elsif (ref $is_duration eq 'ARRAY') { }
15 28 elsif ($piece->[0] =~ /m/) { }
5 23 elsif ($piece->[0] =~ /h/) { }
2 21 elsif ($piece->[0] =~ m[AM?/PM?]i) { }
1 20 elsif ($piece->[0] =~ /d{3,5}/) { }
1 19 elsif (not $sub_seconds and $piece->[0] =~ /[\.]/) { }
1 18 elsif ($sub_seconds eq '1') { }
455 1 0 if ($is_duration->[0] =~ /[hms]/) { }
468 0 2 if ($piece->[0] eq '.') { }
2 0 elsif ($piece->[0] =~ /$next_duration/) { }
475 1 1 if $piece->[1]
478 0 2 if ($piece->[0] =~ /^0+$/)
494 7 8 if ($cldr_string and $cldr_string =~ /:'?$/ or $piece->[1] and $piece->[1] eq ':') { }
520 1 0 if ($piece->[0] =~ /^0+$/) { }
530 1 45 if ($sub_seconds and $sub_seconds ne '1') { }
536 27 21 if ($piece->[1])
537 0 27 if ($sub_seconds and $sub_seconds ne '1') { }
556 16 0 $self->get_epoch_year == 1904 ? :
562 16 86 unless (defined $num)
578 6 80 if ($is_duration) { }
580 0 6 if ($self->get_date_behavior)
584 0 6 $sign == -1 ? :
592 2 78 if ($self->get_date_behavior)
597 6 72 if ($sub_seconds)
601 5 1 if ("0.$calc_sub_secs" >= 0.5)
610 6 72 if ($sub_seconds and $sub_seconds ne '1')
613 0 78 if $format_remainder
636 0 23 unless ($date)
640 14 9 if ($date =~ /(.*:\d+)\.(\d+)(.*)/)
643 14 0 if $3
659 1 0 unless ($dt_us or $dt_eu)
665 0 1 $century_postfix + 20 > 99 ? :
666 1 0 $century_postfix - 79 < 0 ? :
668 1 0 if (defined $1 and defined $2 and defined $3)
672 0 1 defined $drop_year && $year >= $drop_year ? :
0 1 defined $bump_year && $year <= $bump_year ? :
681 19 0 $dt_us ? :
4 19 $self->get_european_first && $dt_eu ? :
686 23 0 if ($dt) { }
687 14 9 if $calc_sub_secs
696 1 22 if ($this_duration) { }
697 1 0 $self->get_epoch_year == 1904 ? :
700 0 1 if ($self->get_date_behavior)
704 1 0 $sign == -1 ? :
715 0 22 if ($self->get_date_behavior)
718 1 21 if ($this_sub_seconds)
722 0 1 if ("0.$calc_sub_secs" >= 0.5)
731 1 21 if ($this_sub_seconds and $this_sub_seconds ne '1')
734 0 22 if $this_format_rem
757 0 21 if ($key eq '0')
763 7 14 if ($key eq 's')
764 0 7 $first ? :
772 7 14 if ($key eq 'm')
775 0 7 $first ? :
784 7 14 if ($key eq 'h')
787 7 0 $first ? :
796 14 7 if $duration_ref->[2][$position]
812 4 0 if ($type_filter->name eq 'ZeroOrUndef' and not $list_ref->[-1][0] and $list_ref->[-1][1] eq '"-"')
828 105 28 if (defined $piece->[0])
829 83 22 if (my(@result) = $piece->[0] =~ /^([0-9#\?]+)([,\-\_])?([#0\?]+)?(,+)?$/) { }
22 0 elsif ($piece->[0] =~ /^((\.)|([Ee][+\-])|(%))$/) { }
832 27 56 $2 ? :
27 56 defined $3 ? :
834 27 56 $3 ? :
835 0 0 $2 && $2 ne ',' ? :
0 83 $4 ? :
836 31 52 if $1 =~ /^([0-9]+)$/
838 53 30 if ($comma_less =~ /^[\#\?]*(0+)$/)
841 25 58 if ($comma_less =~ /^(0+)[\#\?]*$/)
844 0 83 if $divide_by_thousands
853 43 40 if (not $number_type) { }
27 13 elsif ($number_type eq 'INTEGER' or $number_type eq 'DECIMAL') { }
13 0 elsif ($number_type eq 'SCIENTIFIC' or $number_type eq 'FRACTION') { }
855 0 43 if $leading_zeros and length $leading_zeros
857 27 16 if ($comma)
860 16 27 if (defined $piece->[1])
861 10 6 if ($piece->[1] =~ /(\s+)/) { }
0 6 elsif ($piece->[1] eq '/') { }
865 0 0 if $leading_zeros and length $leading_zeros
870 10 17 if ($piece->[1] and $piece->[1] eq '/') { }
874 16 1 if $trailinq_zeros and length $trailinq_zeros
878 1 12 if $leading_zeros and length $leading_zeros
880 7 6 if ($divisor)
887 17 5 if ($2) { }
3 2 elsif ($3) { }
905 12 31 if ($type_filter->name eq 'NegativeNum')
933 14 14 if (not $found_integer and defined $piece->[0])
937 18 10 if ($piece->[1])
954 6 56 if (not defined $adjusted_input or $adjusted_input eq '')
971 6 50 if $built_ref->{'sign'} and $return
994 42 14 if (defined $piece->[0])
995 14 28 if ($piece->[0] eq '.') { }
1001 18 38 if ($piece->[1])
1017 6 56 if (not defined $adjusted_input or $adjusted_input eq '')
1035 6 50 if $built_ref->{'sign'} and $return
1059 6 0 if (defined $piece->[0])
1060 2 4 if ($piece->[0] eq '%') { }
1 3 elsif ($piece->[0] eq '.') { }
1069 0 6 if ($piece->[1])
1073 1 1 if $decimal_count < 2
1086 2 14 if (not defined $adjusted_input or $adjusted_input eq '')
1100 7 7 if ($decimal_count < 2) { }
1112 2 12 if $built_ref->{'sign'} and $return
1132 2 1 exists $conversion_defs->{'decimal'} ? :
1136 13 0 if (defined $piece->[0])
1137 3 10 if ($piece->[0] =~ /(E)(.)/) { }
2 8 elsif ($piece->[0] eq '.') { }
3 5 elsif ($exponent_sprintf) { }
1140 3 0 if $2 eq '+'
1141 1 2 if (exists $conversion_defs->{'exponent'}{'leading_zeros'})
1154 0 13 if ($piece->[1])
1165 3 24 if (not defined $adjusted_input or $adjusted_input eq '') { }
24 0 elsif ($adjusted_input =~ /^\-?\d*(\.\d+)?$/ or $adjusted_input =~ /^(\-)?((\d{1,3})?(\.\d+)?)[Ee](\-)?(\d+)$/ and $2 and $6 and $6 < 309) { }
1183 8 16 if ($built_ref->{'no_decimal'}) { }
1197 12 12 if $built_ref->{'sign'} and $return
1230 10 230 if (not defined $adjusted_input or $adjusted_input eq '')
1244 149 81 if ($built_ref->{'integer'}{'value'})
1246 117 32 if ($built_ref->{'fraction'}{'value'})
1250 166 64 if ($built_ref->{'fraction'}{'value'})
1253 32 0 if (not $return and $built_ref->{'initial_value'})
1256 95 135 if $built_ref->{'sign'} and $return
1287 36 344 if ($value_definitions->{'negative_type'} and $value_definitions->{'initial_value'} < 0)
1301 0 112 if ($value_definitions->{'initial_value'} and $value_definitions->{'divide_by_thousands'})
1333 136 244 if ($value_definitions->{'initial_value'} < 0)
1354 18 6 if (defined $value_definitions->{'integer'}{'value'} and sprintf('%.0f', $value_definitions->{'integer'}{'value'}) =~ /([1-9])/) { }
6 0 elsif ($value_definitions->{'decimal'}{'value'}) { }
1360 6 0 if ($value_definitions->{'decimal'}{'value'} =~ /E(-?\d+)$/i) { }
0 0 elsif ($value_definitions->{'decimal'}{'value'} =~ /([1-9])/) { }
1376 6 18 if ($exponent < 0) { }
11 7 elsif ($exponent > 0) { }
1409 71 79 if ($value_definitions->{'no_decimal'}) { }
79 0 elsif ($value_definitions->{'decimal'}{'max_length'}) { }
1410 17 54 if ($value_definitions->{'decimal'}{'value'} > 0.4998)
1420 35 44 if ($value_definitions->{'decimal'}{'value'})
1426 0 35 if ($round_decimal >= 1)
1437 45 34 unless ($value_definitions->{'decimal'}{'value'})
1453 106 274 if (exists $value_definitions->{'integer'}{'comma'})
1472 8 16 if ($value_definitions->{'exponent'}{'leading_zeros'})
1488 230 0 if ($value_definitions->{'decimal'}{'value'})
1496 138 92 $value_definitions->{'fraction'}{'divisor'} ? :
1500 23 207 if ($value_definitions->{'fraction'}{'value'} eq '1')
1521 77 61 if ($low_delta < $high_delta) { }
1523 44 33 if $return
1526 17 44 if ($high_numerator == $divisor) { }
1532 88 50 if $add_denominator
1547 106 0 if (&is_Int($int)) { }
1573 0 92 unless &is_Num($decimal)
1580 68 144 if ($integer > 999 or $decimal < 1e-05 and $decimal > 1e-10)
1584 60 8 if ($integer <= 999)
1597 20 72 if (not $numerator or $denominator and length $denominator > $max_digits)
1604 3 17 $start_decimal >= 0.5 ? :
1619 15 1146 if ($fixed_list[0]{'delta'} < $lowest->{'delta'})
1635 8 84 if (not $numerator) { }
6 78 elsif (not $denominator or $denominator == 1) { }
1693 0 112 if ($m < 0)
1698 22 90 if $m == 1
1703 112 0 if (wantarray) { }
1706 0 0 $m ? :
1720 232 224 if (wantarray) { }