Branch Coverage

blib/lib/Spreadsheet/XLSX/Reader/LibXML/ParseExcelFormatStrings.pm
Criterion Covered Total %
branch 312 390 80.0


line true false branch
123 0 0 unless (defined $coercion_string)
130 0 0 unless ($coercion)
146 0 48 unless (defined $format_strings)
157 48 0 if ($self->get_cache_behavior)
162 0 48 if ($self->_has_cached_format($cache_key)) { }
175 8 40 $format_string_list[-1] =~ /\@/ ? :
180 8 6 scalar(@format_string_list) - $last_is_text == 2 ? :
34 14 scalar(@format_string_list) - $last_is_text == 1 ? :
228 97 98 if ($fixed_value)
229 2 95 if ($fixed_value =~ /\[\$([^\-\]]*)\-?\d*\]/) { }
4 91 elsif ($fixed_value =~ /\[[^hms]*\]/) { }
2 176 elsif ($fixed_value =~ /\"\-\"/ and $format_string) { }
241 159 36 if (defined $pre_action) { }
242 8 0 $text ? :
107 8 defined $number ? :
44 115 $date ? :
246 44 115 if $date
250 20 91 if ($action_type and $current_action and $current_action ne $action_type)
255 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') { }
259 2 2 if ($current_action eq 'NUMBER') { }
2 0 elsif ($pre_action eq '@') { }
262 2 0 if ($pre_action =~ /^\.$/ and $format_string =~ /^0+/ or $pre_action =~ /^0+$/ and $deconstructed_list[-1][0] =~ /^\.$/)
276 4 0 if ($current_action eq 'TEXT')
284 12 0 if ($current_action eq 'NUMBER')
290 0 20 if ($fail)
294 159 0 if $current_action
305 0 195 if ($x++ == 30)
313 70 125 if length $format_string == 0
315 0 70 if $format_string
318 47 23 $action_type =~ /^(NUMBER|SCIENTIFIC|INTEGER|PERCENT|FRACTION|DECIMAL)$/ ? :
320 6 64 $action_type && $action_type eq 'TEXT' ? :
321 2 68 if ($action_type and $action_type eq 'DATESTRING')
331 64 6 $intermediate_action =~ /^(NUMBER|SCIENTIFIC|INTEGER|PERCENT|FRACTION|DECIMAL|DATE|DATESTRING)$/ ? :
334 13 35 if ($is_date and not $date_text)
337 13 0 $intermediate_action =~ /^(NUMBER|SCIENTIFIC|INTEGER|PERCENT|FRACTION|DECIMAL|DATE|DATESTRING)$/ ? :
347 6 42 if $action_type eq 'TEXT'
348 0 48 if $coercion_name
363 48 0 if ($self->get_cache_behavior)
400 6 0 if (not $found_string and defined $piece->[0])
404 0 6 if ($piece->[1])
433 14 1 unless ($self->get_date_behavior)
439 43 2 if (defined $piece->[0])
442 1 42 if ($piece->[0] =~ /\[(.+)\]/) { }
2 40 elsif (ref $is_duration eq 'ARRAY') { }
14 26 elsif ($piece->[0] =~ /m/) { }
5 21 elsif ($piece->[0] =~ /h/) { }
2 19 elsif ($piece->[0] =~ m[AM?/PM?]i) { }
1 18 elsif ($piece->[0] =~ /d{3,5}/) { }
1 17 elsif (not $sub_seconds and $piece->[0] =~ /[\.]/) { }
1 16 elsif ($sub_seconds eq '1') { }
447 1 0 if ($is_duration->[0] =~ /[hms]/) { }
460 0 2 if ($piece->[0] eq '.') { }
2 0 elsif ($piece->[0] =~ /$next_duration/) { }
467 1 1 if $piece->[1]
470 0 2 if ($piece->[0] =~ /^0+$/)
486 7 7 if ($cldr_string and $cldr_string =~ /:'?$/ or $piece->[1] and $piece->[1] eq ':') { }
512 1 0 if ($piece->[0] =~ /^0+$/) { }
522 1 42 if ($sub_seconds and $sub_seconds ne '1') { }
528 25 20 if ($piece->[1])
529 0 25 if ($sub_seconds and $sub_seconds ne '1') { }
548 15 0 $self->get_epoch_year == 1904 ? :
554 14 86 unless (defined $num)
570 6 80 if ($is_duration) { }
572 0 6 if ($self->get_date_behavior)
576 0 6 $sign == -1 ? :
584 2 78 if ($self->get_date_behavior)
589 6 72 if ($sub_seconds)
593 5 1 if ("0.$calc_sub_secs" >= 0.5)
602 6 72 if ($sub_seconds and $sub_seconds ne '1')
605 0 78 if $format_remainder
625 0 14 unless ($date)
629 14 0 if ($date =~ /(.*:\d+)\.(\d+)(.*)/)
632 14 0 if $3
638 14 0 if $calc_sub_secs
650 1 13 if ($last_duration) { }
651 1 0 $self->get_epoch_year == 1904 ? :
654 0 1 if ($self->get_date_behavior)
658 1 0 $sign == -1 ? :
669 0 13 if ($self->get_date_behavior)
672 1 12 if ($last_sub_seconds)
676 0 1 if ("0.$calc_sub_secs" >= 0.5)
685 1 12 if ($last_sub_seconds and $last_sub_seconds ne '1')
688 0 13 if $last_format_rem
711 0 21 if ($key eq '0')
717 7 14 if ($key eq 's')
718 0 7 $first ? :
726 7 14 if ($key eq 'm')
729 0 7 $first ? :
738 7 14 if ($key eq 'h')
741 7 0 $first ? :
750 14 7 if $duration_ref->[2][$position]
766 4 0 if ($type_filter->name eq 'ZeroOrUndef' and not $list_ref->[-1][0] and $list_ref->[-1][1] eq '"-"')
782 105 28 if (defined $piece->[0])
783 83 22 if (my(@result) = $piece->[0] =~ /^([0-9#\?]+)([,\-\_])?([#0\?]+)?(,+)?$/) { }
22 0 elsif ($piece->[0] =~ /^((\.)|([Ee][+\-])|(%))$/) { }
786 27 56 $2 ? :
27 56 defined $3 ? :
788 27 56 $3 ? :
789 0 0 $2 && $2 ne ',' ? :
0 83 $4 ? :
790 31 52 if $1 =~ /^([0-9]+)$/
792 53 30 if ($comma_less =~ /^[\#\?]*(0+)$/)
795 25 58 if ($comma_less =~ /^(0+)[\#\?]*$/)
798 0 83 if $divide_by_thousands
807 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') { }
809 0 43 if $leading_zeros and length $leading_zeros
811 27 16 if ($comma)
814 16 27 if (defined $piece->[1])
815 10 6 if ($piece->[1] =~ /(\s+)/) { }
0 6 elsif ($piece->[1] eq '/') { }
819 0 0 if $leading_zeros and length $leading_zeros
824 10 17 if ($piece->[1] and $piece->[1] eq '/') { }
828 16 1 if $trailinq_zeros and length $trailinq_zeros
832 1 12 if $leading_zeros and length $leading_zeros
834 7 6 if ($divisor)
841 17 5 if ($2) { }
3 2 elsif ($3) { }
859 12 31 if ($type_filter->name eq 'NegativeNum')
887 14 14 if (not $found_integer and defined $piece->[0])
891 18 10 if ($piece->[1])
908 6 56 if (not defined $adjusted_input or $adjusted_input eq '')
925 6 50 if $built_ref->{'sign'} and $return
948 42 14 if (defined $piece->[0])
949 14 28 if ($piece->[0] eq '.') { }
955 18 38 if ($piece->[1])
971 6 56 if (not defined $adjusted_input or $adjusted_input eq '')
989 6 50 if $built_ref->{'sign'} and $return
1013 6 0 if (defined $piece->[0])
1014 2 4 if ($piece->[0] eq '%') { }
1 3 elsif ($piece->[0] eq '.') { }
1023 0 6 if ($piece->[1])
1027 1 1 if $decimal_count < 2
1040 2 14 if (not defined $adjusted_input or $adjusted_input eq '')
1054 7 7 if ($decimal_count < 2) { }
1066 2 12 if $built_ref->{'sign'} and $return
1086 2 1 exists $conversion_defs->{'decimal'} ? :
1090 13 0 if (defined $piece->[0])
1091 3 10 if ($piece->[0] =~ /(E)(.)/) { }
2 8 elsif ($piece->[0] eq '.') { }
3 5 elsif ($exponent_sprintf) { }
1094 3 0 if $2 eq '+'
1095 1 2 if (exists $conversion_defs->{'exponent'}{'leading_zeros'})
1108 0 13 if ($piece->[1])
1119 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) { }
1137 8 16 if ($built_ref->{'no_decimal'}) { }
1151 12 12 if $built_ref->{'sign'} and $return
1184 10 230 if (not defined $adjusted_input or $adjusted_input eq '')
1198 149 81 if ($built_ref->{'integer'}{'value'})
1200 117 32 if ($built_ref->{'fraction'}{'value'})
1204 166 64 if ($built_ref->{'fraction'}{'value'})
1207 32 0 if (not $return and $built_ref->{'initial_value'})
1210 95 135 if $built_ref->{'sign'} and $return
1241 36 344 if ($value_definitions->{'negative_type'} and $value_definitions->{'initial_value'} < 0)
1255 0 112 if ($value_definitions->{'initial_value'} and $value_definitions->{'divide_by_thousands'})
1287 136 244 if ($value_definitions->{'initial_value'} < 0)
1308 18 6 if (defined $value_definitions->{'integer'}{'value'} and sprintf('%.0f', $value_definitions->{'integer'}{'value'}) =~ /([1-9])/) { }
6 0 elsif ($value_definitions->{'decimal'}{'value'}) { }
1314 6 0 if ($value_definitions->{'decimal'}{'value'} =~ /E(-?\d+)$/i) { }
0 0 elsif ($value_definitions->{'decimal'}{'value'} =~ /([1-9])/) { }
1330 6 18 if ($exponent < 0) { }
11 7 elsif ($exponent > 0) { }
1363 71 79 if ($value_definitions->{'no_decimal'}) { }
79 0 elsif ($value_definitions->{'decimal'}{'max_length'}) { }
1364 17 54 if ($value_definitions->{'decimal'}{'value'} > 0.4998)
1374 35 44 if ($value_definitions->{'decimal'}{'value'})
1380 0 35 if ($round_decimal >= 1)
1391 45 34 unless ($value_definitions->{'decimal'}{'value'})
1407 106 274 if (exists $value_definitions->{'integer'}{'comma'})
1426 8 16 if ($value_definitions->{'exponent'}{'leading_zeros'})
1442 230 0 if ($value_definitions->{'decimal'}{'value'})
1450 138 92 $value_definitions->{'fraction'}{'divisor'} ? :
1454 23 207 if ($value_definitions->{'fraction'}{'value'} eq '1')
1475 77 61 if ($low_delta < $high_delta) { }
1477 44 33 if $return
1480 17 44 if ($high_numerator == $divisor) { }
1486 88 50 if $add_denominator
1501 106 0 if (&is_Int($int)) { }
1527 0 92 unless &is_Num($decimal)
1534 68 144 if ($integer > 999 or $decimal < 1e-05 and $decimal > 1e-10)
1538 60 8 if ($integer <= 999)
1551 20 72 if (not $numerator or $denominator and length $denominator > $max_digits)
1558 3 17 $start_decimal >= 0.5 ? :
1573 15 1146 if ($fixed_list[0]{'delta'} < $lowest->{'delta'})
1589 8 84 if (not $numerator) { }
6 78 elsif (not $denominator or $denominator == 1) { }
1647 0 112 if ($m < 0)
1652 22 90 if $m == 1
1657 112 0 if (wantarray) { }
1660 0 0 $m ? :
1674 232 224 if (wantarray) { }