| blib/lib/LaTeX/Replicase.pm | |||
|---|---|---|---|
| Criterion | Covered | Total | % |
| branch | 300 | 368 | 81.5 |
| line | true | false | branch |
|---|---|---|---|
| 32 | 4 | 11 | if not $_[0] or $_[0] =~ /^[a-zA-Z0-9,=:;!\.\s\+\-\*]+$/ or $_[0] =~ s/^%%%:// |
| 39 | 2 | 9 | if $_[1] and $_[1] =~ /~/ |
| 47 | 18 | 3 | if defined $op{'debug'} |
| 51 | 20 | 1 | if (defined $source and length $source) { } |
| 53 | 17 | 3 | if (ref \$source eq 'SCALAR') { } |
| 1 | 2 | elsif (ref $source ne 'ARRAY') { } | |
| 58 | 17 | 0 | if $^O =~ /(?:linux|bsd|darwin|solaris|sunos)/ |
| 63 | 0 | 1 | unless $op{'silent'} |
| 72 | 0 | 1 | unless $op{'silent'} |
| 78 | 2 | 17 | if $DEBUG |
| 80 | 1 | 18 | if (ref \$source eq "SCALAR" and not -s $source or ref $source eq "ARRAY" and not @$source) |
| 82 | 0 | 1 | unless $op{'silent'} |
| 89 | 2 | 1 | unless ($info and ref $info eq 'HASH' && %$info || ref $info eq 'ARRAY' && @$info) |
| 93 | 0 | 2 | unless $op{'silent'} |
| 103 | 14 | 2 | if (ref \$source eq 'SCALAR') { } |
| 112 | 15 | 1 | if (defined($_ = $op{'ofile'}) and length $_) { } |
| 113 | 1 | 14 | if (/::STDOUT$/) { } |
| 119 | 14 | 0 | $^O =~ /(?:linux|bsd|darwin|solaris|sunos)/ ? : |
| 124 | 1 | 0 | if (length $outdir) { } |
| 129 | 1 | 0 | if $^O =~ /(?:linux|bsd|darwin|solaris|sunos)/ |
| 136 | 1 | 0 | unless (-d $outdir) |
| 139 | 0 | 1 | if ($err and @$err) |
| 143 | 0 | 0 | $path && length $path ? : |
| 146 | 0 | 0 | unless $op{'silent'} |
| 158 | 2 | 14 | if $DEBUG |
| 161 | 1 | 3 | if (-s $ofile and ref \$source eq "SCALAR" and $source eq $ofile && compare($source, $ofile) == 0 || join(',', stat $source) eq join(',', stat $ofile)) |
| 169 | 0 | 1 | unless $op{'silent'} |
| 176 | 13 | 2 | if (ref \$source eq "SCALAR") |
| 177 | 1 | 12 | $op{'utf8'} ? : |
| 179 | 2 | 11 | if $DEBUG |
| 181 | 0 | 13 | unless (open $TEMPLATE, "<:raw$mode", $source) |
| 183 | 0 | 0 | unless $op{'silent'} |
| 190 | 14 | 1 | unless ($fh) |
| 191 | 1 | 13 | $op{'utf8'} ? : |
| 193 | 2 | 12 | if $DEBUG |
| 195 | 0 | 14 | unless (open $fh, ">$mode", $ofile) |
| 197 | 0 | 0 | unless $op{'silent'} |
| 224 | 13 | 2 | if ($TEMPLATE) { } |
| 227 | 10 | 860 | if (&_line_decryption($fh, $info, \$z, \$data, \$vardata, \$chkVAR, \$key, \$tdz, \@columns, \%op)) |
| 240 | 6 | 222 | if ($e) { } |
| 249 | 0 | 15 | if (defined $key) |
| 253 | 0 | 0 | unless $op{'silent'} |
| 257 | 14 | 1 | unless $ofile =~ /::STDOUT$/ |
| 259 | 9 | 6 | unless @logs |
| 273 | 471 | 621 | if (defined $$key) { } |
| 38 | 583 | elsif ($$z =~ /%%%+END(? |
|
| 275 | 114 | 357 | unless $$z =~ /%%%[AETV]\S*:/ |
| 277 | 70 | 287 | if ($$z =~ /%%%(?:END(? |
| 287 | 0 | elsif (ref $$vardata eq 'HASH' and ref $$$vardata{$$key} eq 'HASH' || ref $$$vardata{$$key} eq 'ARRAY' || ref \$$$vardata{$$key} eq 'SCALAR' || ref $$$vardata{$$key} eq 'SCALAR' or ref $$vardata eq 'ARRAY' and ref $$$vardata[$$key] eq 'HASH' || ref $$$vardata[$$key] eq 'ARRAY' || ref \$$$vardata[$$key] eq 'SCALAR' || ref $$$vardata[$$key] eq 'SCALAR') { } | |
| 286 | 6 | 64 | if $t and $t eq "T" |
| 288 | 3 | 61 | if $t and $t eq "Z" |
| 290 | 54 | 10 | if $$z =~ /%%%ENDZ?:/ |
| 292 | 7 | 3 | if ($$z =~ /%%%+TDZ:/) |
| 313 | 285 | 2 | ref $$vardata eq 'HASH' ? : |
| 314 | 22 | 265 | ref \$vk eq 'SCALAR' || ref $vk eq 'SCALAR' ? : |
| 317 | 113 | 174 | @$columns && exists $columns->[-1]{'ki'} ? : |
| 320 | 68 | 219 | if $j < 0 or $sclr |
| 322 | 112 | 175 | if (not $sclr and $$z =~ /%%%V:\s*([^\s:%#]+)(%?)\s?(.*)/) { } |
| 173 | 2 | elsif ($$z =~ /(? %?)/ or $$z =~ /^\s*%%%+ADD(? %?)\s?(? |
|
| 328 | 32 | 80 | if ($$chkVAR == 1) { } |
| 35 | 45 | elsif ($$chkVAR == 2) { } | |
| 15 | 30 | elsif ($$chkVAR == 4 or $$chkVAR == 8) { } | |
| 24 | 6 | elsif (ref $vk eq 'HASH' and ref \$vk->{$ki} eq 'SCALAR' && defined $vk->{$ki} || ref $vk->{$ki} eq 'SCALAR' && defined ${$$vk{$ki};} || $ki eq '@' && exists $vk->{$ki} && ref $vk->{$ki} eq 'ARRAY') { } | |
| 330 | 1 | 31 | if ($ki eq '@') { } |
| 16 | 15 | elsif ($ki =~ /^\-*(\d+)$/ and $1 < @$vk || $ki < 0 && $1 == @$vk) { } | |
| 15 | 0 | elsif ($ki =~ /^[\d,\-]+$/) { } | |
| 347 | 0 | 0 | if $DEBUG or not $op->{'ignore'} |
| 354 | 35 | 0 | if (exists $d->{$ki}) |
| 362 | 5 | 10 | if ($ki eq '@') { } |
| 4 | 6 | elsif ($ki =~ /^\-*(\d+)$/ and $1 < @$vk || $ki < 0 && $1 == @$vk) { } | |
| 5 | 1 | elsif ($ki =~ /^[\d,\-]+$/) { } | |
| 392 | 105 | 7 | if exists $columns->[$j]{'ki'} |
| 399 | 45 | 128 | if ($+{'p'}) { } |
| 400 | 1 | 44 | unless length $s |
| 406 | 23 | 149 | if ($+{'t'} eq 'E') { } |
| 407 | 23 | 0 | if (@$columns and exists $columns->[-1]{'ki'} and !$columns->[$j] || $sclr) { } |
| 416 | 33 | 116 | if not $sclr and $+{'t'} eq "X" |
| 434 | 6 | 32 | if $+{'t'} eq "T" |
| 436 | 21 | 11 | if $+{'t'} eq "Z" |
| 440 | 10 | 576 | if $$z =~ s/^\s*%%%+TDZ:\s?[\r\n]*// |
| 442 | 124 | 462 | if ($$tdz) |
| 443 | 116 | 8 | if (length $$z) |
| 450 | 86 | 376 | if ($$z =~ /(.*?)\s?%%%+VAR:\s*([^\s:%#]+)(%?)\s?(.*)/) { } |
| 0 | 376 | elsif ($$z =~ /%%%V:\s*=(def|esc|ignore|silent|debug)=\s*(\S*)/) { } | |
| 48 | 328 | elsif ($$z =~ /%%%V:\s*(? %?)\s?(? |
|
| 457 | 5 | 81 | $k =~ s[^/+][] ? : |
| 464 | 0 | 87 | unless length $sk |
| 466 | 3 | 84 | if ($sk =~ /^\d+$/ and ref $vd eq 'ARRAY' and defined $vd->[$sk]) { } |
| 69 | 15 | elsif (ref $vd eq 'HASH' and exists $vd->{$sk}) { } | |
| 467 | 1 | 2 | if &_data_redef($sk, $vd->[$sk], \$k, \$vd, \$x) |
| 470 | 25 | 44 | if &_data_redef($sk, $vd->{$sk}, \$k, \$vd, \$x) |
| 483 | 15 | 71 | if ($x) |
| 484 | 13 | 2 | if $DEBUG or not $op->{'ignore'} |
| 493 | 6 | 65 | if $DEBUG |
| 495 | 2 | 0 | ref $$vardata eq 'ARRAY' ? : |
| 69 | 2 | ref $$vardata eq 'HASH' ? : | |
| 498 | 0 | 71 | unless ($vk) |
| 499 | 0 | 0 | if $DEBUG and $op->{'def'} |
| 503 | 1 | 70 | if &_chk_var($fh, $k, $vk, $Np, \$paste, \$before, $chkVAR, $columns, $z, $op) |
| 523 | 7 | 41 | if ($k =~ s[^/+][]) |
| 526 | 4 | 3 | unless length $k |
| 532 | 0 | 51 | unless length $sk |
| 535 | 6 | 45 | if ($sk =~ /^\d+$/ and ref $$data eq 'ARRAY' and defined $$data->[$sk]) { } |
| 15 | 30 | elsif (ref $$data eq 'HASH' and exists $$data->{$sk}) { } | |
| 542 | 28 | 2 | if $DEBUG or not $op->{'ignore'} |
| 552 | 9 | 12 | if (ref $d eq "ARRAY" or ref $d eq "HASH") |
| 558 | 10 | 2 | if (ref \$d eq 'SCALAR') { } |
| 1 | 1 | elsif (ref $d eq 'SCALAR') { } | |
| 565 | 1 | 0 | if $DEBUG or not $op->{'ignore'} |
| 580 | 42 | 2 | if $x |
| 595 | 37 | 142 | if $Np |
| 596 | 14 | 165 | if length $paste |
| 602 | 46 | 26 | if (ref $d eq "ARRAY" or ref $d eq "HASH") |
| 607 | 26 | 0 | if (ref \$d eq 'SCALAR' or ref $d eq 'SCALAR') { } |
| 623 | 36 | 35 | if (ref $vk eq 'ARRAY') { } |
| 26 | 9 | elsif (ref \$vk eq 'SCALAR' or ref $vk eq 'SCALAR') { } | |
| 625 | 35 | 1 | if (@{$vk;}) { } |
| 629 | 35 | 92 | if (ref $d eq 'ARRAY') { } |
| 22 | 70 | elsif (ref $d eq 'HASH') { } | |
| 66 | 4 | elsif (ref \$d eq 'SCALAR') { } | |
| 4 | 0 | elsif (ref $d eq 'SCALAR') { } | |
| 650 | 1 | 35 | if (not $$chkVAR or $$chkVAR > 8 or $$chkVAR & $$chkVAR - 1) |
| 651 | 1 | 0 | if $DEBUG or not $op->{'ignore'} |
| 663 | 13 | 57 | if ($$before) |
| 674 | 3 | 415 | if ref $v eq "SCALAR" |
| 680 | 378 | 40 | if (defined $v) { } |
| 681 | 3 | 375 | if $op->{'esc'} |
| 683 | 44 | 334 | if $DEBUG |
| 686 | 10 | 368 | if exists $el->{'p'} |
| 690 | 126 | 252 | if $el->{'%'} |
| 696 | 4 | 0 | if $DEBUG and $op->{'def'} |
| 705 | 413 | 401 | unless $el->{$ht} |
| 713 | 33 | 16 | if $ht eq "head" and ($border and exists $el->{'eX'} and exists $el->{'eX'}{$i}) |
| 715 | 47 | 410 | if $DEBUG |
| 734 | 4 | 407 | if (length $ki and not defined $val) |
| 735 | 1 | 0 | if $DEBUG and $op->{'def'} |
| 754 | 4 | 193 | if ref $val eq "SCALAR" |
| 756 | 195 | 2 | if (ref \$val eq 'SCALAR') { } |
| 2 | 0 | elsif (ref $val eq 'ARRAY') { } | |
| 763 | 0 | 17 | if ref \$_ ne "SCALAR" |
| 781 | 1 | 138 | if $ii eq "-" |
| 783 | 12 | 126 | if ($ii =~ /^(\-[1-9]\d*)\-(\d*)$/) |
| 786 | 1 | 11 | if abs $s > $nd |
| 787 | 1 | 11 | if abs $e > $nd |
| 788 | 1 | 11 | if $e > $s |
| 796 | 1 | 125 | if ($ii =~ /^\-[0-9]+$/) |
| 799 | 1 | 0 | if (abs $i <= $nd) |
| 807 | 124 | 1 | if (@n < 2 and $n[0] < $nd) { } |
| 808 | 17 | 107 | if ($ii =~ /\-$/) { } |
| 834 | 68 | 2 | ref $vardata eq 'HASH' ? : |
| 836 | 0 | 70 | unless @$columns |
| 842 | 26 | 44 | if (ref \$values eq "SCALAR" or ref $values eq "SCALAR") |
| 847 | 35 | 9 | if (ref $values eq 'ARRAY') { } |
| 9 | 0 | elsif (ref $values eq 'HASH') { } | |
| 849 | 1 | 34 | unless (@$values) |
| 850 | 1 | 0 | if $DEBUG or not $op->{'ignore'} |
| 861 | 8 | 81 | if $DEBUG |
| 867 | 45 | 215 | !($row || $col) || $row >= $#{$values;} && !(defined $ki && length $ki) ? : |
| 870 | 223 | 37 | if (defined $ki) { } |
| 871 | 25 | 198 | if (ref \$d eq 'SCALAR' or ref $d eq 'SCALAR') { } |
| 89 | 109 | elsif (ref $d eq 'HASH' and defined $d->{$ki}) { } | |
| 109 | 0 | elsif (ref $d eq 'ARRAY') { } | |
| 0 | 0 | elsif ($op->{'def'}) { } | |
| 873 | 25 | 0 | if ($ki =~ /^[\d,\-]+$/) |
| 875 | 11 | 14 | if $row |
| 877 | 14 | 0 | if ($_ = &_mixed_indices($fh, $ki, $values, $el, $op, $border)) |
| 886 | 2 | 87 | if (ref $val eq 'ARRAY') { } |
| 0 | 87 | elsif (ref \$val ne 'SCALAR') { } | |
| 888 | 0 | 14 | unless ref \$vv eq "SCALAR" |
| 901 | 109 | 0 | if ($ki =~ /^[\d,\-]+$/) |
| 903 | 109 | 0 | if $_ = &_mixed_indices($fh, $ki, $d, $el, $op, $border) |
| 910 | 0 | 0 | if $DEBUG |
| 937 | 11 | 16 | !$col || $col >= $#{$columns;} && !(defined $ki && length $ki) ? : |
| 940 | 24 | 3 | if (defined $ki) { } |
| 941 | 21 | 3 | if (ref \$values->{$ki} eq 'SCALAR' and defined $values->{$ki}) { } |
| 1 | 2 | elsif (ref $values->{$ki} eq 'SCALAR' and defined ${$$values{$ki};}) { } | |
| 2 | 0 | elsif ($ki eq '@' and ref $values->{'@'} eq 'ARRAY') { } | |
| 0 | 0 | elsif ($op->{'def'}) { } | |
| 949 | 1 | 10 | unless defined $k and exists $values->{$k} |
| 952 | 8 | 2 | if (ref \$values->{$k} eq 'SCALAR') { } |
| 1 | 1 | elsif (ref $values->{$k} eq 'SCALAR') { } | |
| 0 | 1 | elsif ($op->{'def'}) { } | |
| 959 | 0 | 0 | if $DEBUG |
| 970 | 0 | 0 | if $DEBUG |