Branch Coverage

blib/lib/String/PictureFormat.pm
Criterion Covered Total %
branch 140 682 20.5


line true false branch
504 0 8 $ops->{'-bad'} ? :
505 4 4 $pic =~ /^.*?([<|>])/o ? :
506 0 8 $$ops{-'sizefixed'} ? :
507 7 1 if ($pic =~ s/^\@//o) { }
1 0 elsif ($pic =~ s/^\=//o) { }
0 0 elsif ($pic =~ s/^\%//o) { }
508 0 7 if $pic =~ s/^(\d+)\://o
509 0 7 if $fixedLeni
510 1 6 if ($pic =~ s[^([\'\"\/\`])][]o) { }
1 5 elsif ($pic =~ s/^\^//o) { }
1 4 elsif ($pic =~ /^(?:s|tr)(\W)/) { }
1 3 elsif ($pic =~ /^[a-zA-Z_]+/o) { }
512 1 0 $pic =~ s/\Q$regexDelimiter\E(.*)$// ? :
526 0 3 if ($one =~ s/\^/./go) { }
534 0 3 if $one =~ /\+$/o
541 0 1 if ($graball) { }
550 1 0 unless ($leni)
561 0 1 if (length $v0 > $charsHandled || $leni > 0 && length $v > $leni and not $ops->{'-truncate'} =~ /no/io)
562 0 0 $ops->{'-truncate'} =~ /er/io ? :
564 1 0 unless $ops->{'-suffix'} =~ /no/io
565 0 1 wantarray ? :
567 1 0 unless $haveTime2fmtstr
568 1 0 $pic =~ s/\^(.*)$// ? :
570 0 1 $v =~ /^\d{9,11}$/o ? :
571 1 0 unless ($perltime)
573 0 1 unless ($t or $perltime)
576 0 0 wantarray ? :
578 0 1 if ($haveTime2fmtstr) { }
1 0 elsif ($perltime) { }
585 1 0 if ($v =~ /^\d{8}\d+$/o)
586 0 1 if ($haveTime2fmtstr) { }
589 0 0 if ($leni and length $t > $leni and not $ops->{'-truncate'} =~ /no/io) { }
590 0 0 $ops->{'-truncate'} =~ /er/io ? :
595 0 0 unless $ops->{'-suffix'} =~ /no/io
596 0 0 wantarray ? :
603 1 0 if ($t =~ /^\d{8}(?: \d{4,6})?$/o) { }
613 0 1 if ($leni and length $t > $leni and not $ops->{'-truncate'} =~ /no/io)
614 0 0 $ops->{'-truncate'} =~ /er/io ? :
617 1 0 unless $ops->{'-suffix'} =~ /no/io
618 0 1 wantarray ? :
622 0 0 wantarray ? :
626 0 1 $pic =~ s/([^$regexDelimiter]+)$// ? :
627 0 1 $suffix =~ s/^(\w+)\;// ? :
630 0 0 if ($leni and length $v > $leni and not $ops->{'-truncate'} =~ /no/io)
631 0 0 $ops->{'-truncate'} =~ /er/io ? :
633 1 0 unless $ops->{'-suffix'} =~ /no/io
634 0 1 wantarray ? :
636 1 0 $pic =~ s/\)([^\)]*)$/)/ ? :
642 0 1 if ($v =~ /^\d+$/o) { }
655 1 0 unless $pic =~ /^\w+\:\:/o
657 0 1 unless $pic =~ /\(.*\)/o
659 0 1 if $@
660 0 0 if ($leni and length $t > $leni and not $ops->{'-truncate'} =~ /no/io)
661 0 0 $ops->{'-truncate'} =~ /er/io ? :
663 1 0 unless $ops->{'-suffix'} =~ /no/io
664 0 1 wantarray ? :
667 0 3 if ($pic =~ /^\*(.*)$/)
670 0 0 if ($leni and length $v > $leni and not $ops->{'-truncate'} =~ /no/io)
671 0 0 $ops->{'-truncate'} =~ /er/io ? :
673 0 0 unless $ops->{'-suffix'} =~ /no/io
674 0 0 wantarray ? :
676 2 1 $pic =~ s/([^\<\|\>\.\^]+)$//o ? :
681 3 4 if ($special eq ',') { }
682 3 0 unless $ops->{'-nonnumeric'}
687 0 3 $float =~ /\+\$/o ? :
688 1 2 if ($float =~ /\(/o)
690 0 1 unless $suffix =~ /^\)/o
692 2 1 if ($v < 0) { }
695 2 0 unless $fixedLeni or $leniSpecified
699 1 0 unless $fixedLeni or $leniSpecified
701 0 1 if not $fixedLeni || $leniSpecified and $float =~ s/\(//o
707 3 0 if $two > 0
712 0 0 $commatize || $float =~ /\$/o || $pic =~ /[\.\,\^\$]/o ? :
714 3 0 unless ($fixedLeni or $leniSpecified)
722 3 0 if ($decPic and not $ops->{'-nonnumeric'}) { }
727 3 0 if $decPic =~ /([\<\|\>])$/o
729 0 0 unless ($pic =~ /\./o or $v =~ /\./)
730 0 0 if $v =~ /^[\+\-\d\. ]+$/o
733 3 0 unless ($float =~ /\+/o)
734 2 1 if $v >= 0 or $suffix =~ /^[\_ ]*CR\s*$/io
738 0 0 if $float =~ s/.(\(?)$/$1/
741 3 0 if ($decJustify eq '>')
747 0 3 if $decLeni < 0
753 0 0 unless ($ops->{'-nonnumeric'})
763 3 0 unless ($ops->{'-nonnumeric'})
765 1 2 if ($v >= 0) { }
771 1 1 if $suffix =~ s/^([\_ ]*)(CR\s*)$/' ' x length($1) . $2;/ie
774 1 2 if $float =~ /[\(\-]/o
779 4 0 unless (not $ops->{'-nonnumeric'} and $t2 eq '(' and $v >= 0)
784 0 0 if $l == $leni and $v < 0 and $float =~ s/\(//o and not $ops->{'-nonnumeric'}
785 3 0 if ($commatize)
787 3 0 if ($decJustify eq '>')
794 6 0 unless $fixedLeni or $leniSpecified
797 0 3 if $switchFloat
798 0 3 if ($ops->{'-truncate'} =~ /er/io and length $t > $leni) { }
3 0 elsif (not $ops->{'-truncate'} =~ /no/io or length $t <= $leni) { }
801 0 3 if not $fixedLeni || $leniSpecified and $float =~ /\(/o
802 0 3 if ($justify eq '|') { }
0 3 elsif ($justify eq '<') { }
805 0 0 wantarray ? :
812 0 0 if not $fixedLeni || $leniSpecified and $float =~ /\(/o
815 2 1 unless $v =~ /\(/o
816 3 0 unless $ops->{'-suffix'} =~ /no/io
817 0 3 wantarray ? :
820 0 1 if $fixedLeni
823 0 1 $pic =~ s/([^wW<|>\d]+)$//o ? :
824 0 1 if $pic =~ /w/o
825 1 0 if $pic =~ /^.*([<|>])/o
828 1 0 unless $fixedLeni
831 0 1 if (length $pic)
832 0 0 !($ops->{'-suffix'} =~ /no/io) ? :
836 1 0 if ($wrapchar eq 'W')
842 0 1 if ($@) { }
846 0 1 if ($justify eq '>') { }
0 1 elsif ($justify eq '|') { }
849 0 0 unless ($ops->{'-suffix'} =~ /no/io)
850 0 0 !$i || $ops->{'-suffix'} =~ /all/io ? :
860 0 0 unless ($ops->{'-suffix'} =~ /no/io)
861 0 0 !$i || $ops->{'-suffix'} =~ /all/io ? :
871 4 0 unless ($ops->{'-suffix'} =~ /no/io)
872 1 3 !$i || $ops->{'-suffix'} =~ /all/io ? :
878 0 1 wantarray ? :
881 0 0 if ($wrapchar eq 'w')
889 0 0 unless ($ops->{'-suffix'} =~ /no/io)
890 0 0 !$j || $ops->{'-suffix'} =~ /all/io ? :
895 0 0 if ($justify eq '>') { }
0 0 elsif ($justify eq '|') { }
904 0 0 wantarray ? :
907 0 0 if $fixedLeni
908 0 0 $pic =~ s/^\$//o ? :
909 0 0 $pic =~ s/^\,//o ? :
910 0 0 $pic =~ s/^(\-?[\d\.]+\w)(.*)$/$1/o ? :
911 0 0 $pic =~ /^\-?(\d+)/ ? :
0 0 unless $fixedLeni
912 0 0 $pic =~ /^\-/o ? :
913 0 0 $lj eq '-' ? :
916 0 0 $pic =~ /\.(\d+)/o ? :
917 0 0 if ($float)
919 0 0 if $pic =~ s/^\%\-/%/o
920 0 0 unless ($fixedLeni)
921 0 0 if $pic =~ /^\%(\d+)/o
926 0 0 if ($commatize) { }
927 0 0 unless ($fixedLeni)
928 0 0 if $pic =~ /^\%(\d+)/o
934 0 0 if ($l > $leni)
936 0 0 wantarray ? :
942 0 0 unless $float
945 0 0 if $float and $l < $leni
947 0 0 unless $ops->{'-suffix'} =~ /no/io
948 0 0 wantarray ? :
962 0 1 $ops->{'-bad'} ? :
963 0 1 $pic =~ /^.*?([<|>])/o ? :
964 0 1 $$ops{-'sizefixed'} ? :
965 1 0 if ($pic =~ s/^\@//o) { }
0 0 elsif ($pic =~ s/^\=//o) { }
0 0 elsif ($pic =~ s/^\%//o) { }
966 0 1 if $fixedLeni
967 0 1 if $pic =~ s/^(\d+)\://o
969 1 0 if ($pic =~ s[^([\'\"/\`])][]o) { }
0 0 elsif ($pic =~ s/^\^//o) { }
0 0 elsif ($pic =~ /^(?:s|tr)(\W)/) { }
0 0 elsif ($pic =~ /^[a-zA-Z_]+/o) { }
971 1 0 if $pic =~ s/\Q$regexDelimiter\E(.*)$//
990 0 0 if ($leni and length $v > $leni and not $ops->{'-truncate'} =~ /no/io)
991 0 0 $ops->{'-truncate'} =~ /er/io ? :
993 0 1 wantarray ? :
995 0 0 unless $haveFmtstr2time
997 0 0 if ($haveFmtstr2time) { }
999 0 0 if ($t =~ /^\d+$/o and $ops->{'-outfmt'})
1000 0 0 unless $haveTime2fmtstr
1001 0 0 if $haveTime2fmtstr
1011 0 0 if index($pic, $i) > 0
1015 0 0 if ($leni and length $t > $leni and not $ops->{'-truncate'} =~ /no/io)
1016 0 0 $ops->{'-truncate'} =~ /er/io ? :
1018 0 0 wantarray ? :
1021 0 0 if $pic =~ s/\Q$regexDelimiter\E(.*)$//
1024 0 0 if ($leni and length $v > $leni and not $ops->{'-truncate'} =~ /no/io)
1025 0 0 $ops->{'-truncate'} =~ /er/io ? :
1027 0 0 wantarray ? :
1029 0 0 if $pic =~ s/\\\;(.*)$//
1033 0 0 if ($v =~ /^\d+$/o) { }
1044 0 0 unless $pic =~ /^\w+\:\:/o
1046 0 0 unless $pic =~ /\(.*\)/o
1048 0 0 if $@
1050 0 0 if ($leni and length $v > $leni and not $ops->{'-truncate'} =~ /no/io)
1051 0 0 $ops->{'-truncate'} =~ /er/io ? :
1053 0 0 wantarray ? :
1055 0 0 if ($pic =~ /^\*(.*)$/)
1058 0 0 if ($leni and length $v > $leni and not $ops->{'-truncate'} =~ /no/io)
1059 0 0 $ops->{'-truncate'} =~ /er/io ? :
1061 0 0 unless $ops->{'-suffix'} =~ /no/io
1062 0 0 wantarray ? :
1064 0 0 if $pic =~ s/([^<|>.]+)$//o
1071 0 0 if ($v =~ /^\D*\-/o) { }
0 0 elsif ($special =~ /\(/o and $v =~ /\(/o) { }
0 0 elsif ($suffix =~ /^[\_ ]*CR\s*$/o and $v =~ s/\s*CR\s*$//o) { }
1076 0 0 unless ($$ops{-'nonnumeric'})
1080 0 0 if $special
1083 0 0 unless $ops->{'-suffix'} =~ /no/io
1085 0 0 if ($isneg)
1086 0 0 unless $v =~ /^\-/o
1092 0 0 if $two > 0
1095 0 0 $pic =~ /^.*?([<|>])/o ? :
1097 0 0 if ($pic =~ /^([<|>]+)[\.\^]([<|>]+)/o) { }
0 0 elsif ($pic =~ /^([\[\<\|\>]+)/o) { }
1100 0 0 unless ($ops->{'-nonnumeric'})
1102 0 0 $two =~ /([\<\|\>])$/o ? :
1103 0 0 if (not $pic =~ /\./o and $v =~ /\./ and $v =~ /^[\+\-\d\. ]+$/o) { }
1104 0 0 if $v =~ /^[\+\-\d\. ]+$/o
1114 0 0 if $leniSpecified and $leni > $leniSpecified
1115 0 0 if ($leni and length $v > $leni)
1116 0 0 if ($decJustify eq '>' and not $ops->{'-nonnumeric'} and $v =~ /^[0-9\+\-]*\.[0-9]+/o)
1119 0 0 unless $v =~ /\./o
1121 0 0 unless length $v
1124 0 0 if ($leni and length $v > $leni)
1125 0 0 unless ($ops->{'-truncate'} =~ /no/io)
1126 0 0 if ($ops->{'-truncate'} =~ /er/io) { }
1129 0 0 if ($justify eq '>') { }
1142 0 0 if ($padcnt > 0)
1143 0 0 if ($justify eq '>') { }
0 0 elsif ($justify eq '|') { }
1147 0 0 $i % 2 ? :
1153 0 0 wantarray ? :
1158 0 0 $pic =~ s/([^wW<|>\d]+)$//o ? :
1159 0 0 if $pic =~ /w/o
1160 0 0 if $pic =~ /^.*([<|>])/o
1162 0 0 if ($justify eq '<') { }
0 0 elsif ($justify eq '>') { }
1170 0 0 if $leni > $leniSpecified
1171 0 0 if ($leni and length $v > $leni) { }
0 0 elsif ($leniSpecified and length $v < $leniSpecified) { }
1172 0 0 unless ($ops->{'-truncate'} =~ /no/io)
1173 0 0 $ops->{'-truncate'} =~ /er/io ? :
1177 0 0 if ($padcnt > 0)
1178 0 0 $justify eq '>' ? :
1181 0 0 wantarray ? :
1183 0 0 $pic =~ s/^\$//o ? :
1184 0 0 $pic =~ s/^\,//o ? :
1185 0 0 if $pic =~ s/^(\-?[\d\.]+\w)(.*)$/$1/o
1186 0 0 $pic =~ /^\-?(\d+)/ ? :
1187 0 0 $pic =~ /^\-/o ? :
1188 0 0 $lj eq '-' ? :
1191 0 0 $pic =~ /\.(\d+)/o ? :
1192 0 0 if ($float)
1194 0 0 if $pic =~ s/^\%\-/%/o
1195 0 0 if $pic =~ /^\%(\d+)/o
1199 0 0 if ($commatize) { }
1200 0 0 if $pic =~ /^\%(\d+)/o
1205 0 0 if ($l > $leni)
1207 0 0 wantarray ? :
1218 0 0 if $float and $l < $leni
1220 0 0 wantarray ? :
1231 1 0 if ($pic =~ s/^\@//o) { }
0 0 elsif ($pic =~ s/^\=//o) { }
0 0 elsif ($pic =~ s/^\%//o) { }
1232 0 1 if ($pic =~ /^(\d+)\:/o) { }
0 1 elsif ($pic =~ s[^([\'\"/\`])][]o) { }
0 1 elsif ($pic =~ s/^\^//o) { }
0 1 elsif ($pic =~ /^(?:s|tr)\W/o) { }
0 1 elsif ($pic =~ /^[a-zA-Z_]+/o) { }
1254 0 1 if $pic =~ /^\*(.*)$/o
1260 1 1 if ($special eq ',') { }
1271 1 0 if $two > 0
1283 0 0 if $pic =~ s/([^wW<|>\d]+)$//o
1284 0 0 if $pic =~ /w/o
1285 0 0 if $pic =~ /^.*([<|>])/o
1290 0 0 $pic =~ s/^\$//o ? :
1291 0 0 $pic =~ s/^\,//o ? :
1292 0 0 $pic =~ s/^(\-?[\d\.]+\w)(.*$)/$1/o ? :
1293 0 0 $pic =~ /^\-?(\d+)/ ? :
1294 0 0 $pic =~ /^\-/o ? :
1297 0 0 if ($float)
1299 0 0 if $pic =~ /^\%(\d+)/o
1301 0 0 if ($commatize)
1302 0 0 if $pic =~ /^\%(\d+)/o
1316 0 0 if ($pic =~ s/^\@//o) { }
0 0 elsif ($pic =~ s/^\=//o) { }
0 0 elsif ($pic =~ s/^\%//o) { }
1318 0 0 if ($pic =~ s[^[\'\"/\`]][]o) { }
0 0 elsif ($pic =~ s/^\^//o) { }
0 0 elsif ($pic =~ /^(?:s|tr)\W/o) { }
0 0 elsif ($pic =~ /^[a-zA-Z_]+/o) { }
1327 0 0 if $pic =~ /^\*(.*)$/
1328 0 0 if $pic =~ s/([^\<\|\>\.\^]+)$//o
1333 0 0 if ($special eq ',') { }
1339 0 0 if ($float =~ /\(/o)
1341 0 0 unless $suffix =~ s/^\)//o
1343 0 0 if ($v < 0) { }
1352 0 0 $pic =~ /^.*?([<|>])/o ? :
1355 0 0 $commatize || $float =~ /\$/o || $pic =~ /[.,\$]/o ? :
1361 0 0 if $pic =~ s/([^wW<|>\d]+)$//o
1362 0 0 if $pic =~ /w/o
1363 0 0 if $pic =~ /^.*([<|>])/o
1366 0 0 $pic =~ s/^\$//o ? :
1367 0 0 $pic =~ s/^\,//o ? :
1368 0 0 $pic =~ s/^(\-?[\d\.]+\w)(.*$)/$1/o ? :
1369 0 0 $pic =~ /^\-?(\d+)/ ? :
1370 0 0 $pic =~ /^\-/o ? :
1385 0 0 if ($pic =~ s/^\@//o) { }
0 0 elsif ($pic =~ s/^\=//o) { }
0 0 elsif ($pic =~ s/^\%//o) { }
1387 0 0 if ($pic =~ s[^([\'\"/\`])][]o) { }
0 0 elsif ($pic =~ s/^\^//o) { }
0 0 elsif ($pic =~ /^(?:s|tr)(\W)/) { }
0 0 elsif ($pic =~ /^[a-zA-Z_]+/o) { }
1389 0 0 if $pic =~ s/\Q$regexDelimiter\E(.*)$//
1392 0 0 if $pic =~ s/\^(.*)$//o
1396 0 0 if $pic =~ s/([^$regexDelimiter]+)$//
1399 0 0 if $pic =~ s/\)([^\)]*)$/)/o
1402 0 0 if $pic =~ /^\*(.*)$/
1403 0 0 if $pic =~ s/([^<|>.]+)$//o
1409 0 0 if $pic =~ s/([^wW<|>\d]+)$//o
1414 0 0 $pic =~ s/^(\-?[\d\.]+\w)(.*)$/$1/o ? :
1429 0 0 wantarray ? :
0 1 unless $dt =~ /\S/o
1430 0 1 if $dt =~ /\d{9,14}\D*$/o
1431 1 0 if ($dt =~ s[(\d+)[\/\-\.](\d+)[\/\-\.](\d+)][]o) { }
0 0 elsif ($dt =~ s/^(\d\d\d\d\d\d+)(\D+\d+\:?\d+.*)?$/$1/o or $dt =~ s/^(\d{8})(\d{4})/$1/o) { }
1434 0 1 if ($1 < 1000 and $3 < 1000) { }
1 0 elsif ($1 > 1000) { }
1436 0 0 $3 < 80 ? :
1448 1 0 if ($dt =~ s/^\D+(\d\d?)\:?(\d\d?)//o) { }
1451 1 0 $dt =~ s/\:?(\d\d?)//o ? :
1452 1 0 if ($dt =~ /(\s*[ap]m?)/i)
1455 1 0 if $x =~ /\d (\d\d)/
1456 0 1 if ($indicator =~ /a/i and $hr == 12) { }
1 0 elsif ($indicator =~ /p/i and $hr != 12) { }
1483 0 1 unless $then > 0
1484 1 0 wantarray ? :
1489 0 0 if (length $dt == 6) { }
1491 0 0 substr($dt, 0, 2) < 80 ? :
1497 0 0 if ($leftpart < 1300)
1504 0 0 if ($timepart =~ s/^(\d\d)(\d\d)//o or $timepart =~ s/^(\d\d?)\:(\d\d?)\:?//o) { }
1507 0 0 $timepart =~ s/(\d\d?)\s*//o ? :
1508 0 0 if ($timepart =~ /([ap]m?)/io)
1511 0 0 if $dt =~ /\d (\d\d)/
1512 0 0 if ($indicator =~ /a/i and $hr == 12) { }
0 0 elsif ($indicator =~ /p/i and $hr != 12) { }
1534 0 0 unless $then > 0
1535 0 0 wantarray ? :
1539 0 0 wantarray ? :