Branch Coverage

blib/lib/Text/Starfish.pm
Criterion Covered Total %
branch 8 476 1.6


line true false branch
56 0 0 if (/^-infile=(.*)$/) { }
0 0 elsif (/^-copyhooks$/) { }
61 0 0 if ($copyhooks)
62 0 0 unless ref $main::Star eq 'Text::Starfish'
72 0 0 unless $copyhooks
81 0 0 if (/^-e=?/) { }
0 0 elsif (/^-mode=/) { }
0 0 elsif (/^-o=/) { }
0 0 elsif (/^-replace$/) { }
0 0 elsif (/^-v$/) { }
89 0 0 if (defined $sf->{'NEW_FILE_MODE'} and $sf->{'NEW_FILE_MODE'} =~ /^0/)
100 0 0 unless defined $sf
110 0 0 if (/^-replace$/) { }
0 0 elsif (/^-noreplace$/) { }
0 0 elsif (/^-require$/) { }
0 0 elsif (not /^-/ and $infile eq '') { }
120 0 0 if ($sf->{'INFILE'} eq '' or not -r $sf->{'INFILE'})
121 0 0 if ($require)
132 0 0 if (defined $self->{'REPLACE'} and not defined $self->{'OUTFILE'})
146 0 0 exists $self->{'OUTFILE'} ? :
149 0 0 if (not defined $self->{'OUTFILE'}) { }
0 0 elsif ($FileCount > 1) { }
0 0 elsif (not -f $self->{'OUTFILE'}) { }
169 0 0 if ($outfileExternal ne '' and $outfileExternal ne $self->{'OUTFILE'})
174 0 0 if ($FileCount == 1 and defined $self->{'OUTFILE'})
176 0 0 if (not -f $self->{'OUTFILE'}) { }
0 0 elsif (defined $self->{'NEW_FILE_MODE'}) { }
179 0 0 if (defined $self->{'NEW_FILE_MODE'}) { }
188 0 0 if ($ExistingText ne $self->{'Out'}) { }
0 0 elsif (defined $self->{'NEW_FILE_MODE'}) { }
189 0 0 if (defined $self->{'OUTFILE'}) { }
195 0 0 if (($mode & 128) == 0 and defined $self->{'NEW_FILE_MODE'}) { }
197 0 0 if ($FileCount == 1) { }
201 0 0 if ($FileCount == 1) { }
207 0 0 if defined $self->{'NEW_FILE_MODE'}
211 0 0 if (defined $self->{'OUTFILE'}) { }
228 0 0 if ($self->{'ttype'} > -1) { }
234 0 0 if ($self->{'CurrentLoop'} < $self->{'Loops'})
236 0 0 if ($self->{'REPLACE'})
240 0 0 if ($savedcontent ne $self->{'Out'})
246 0 0 if (defined $self->{'Final'})
253 0 0 if (defined $self->{'macrosdefined'})
257 0 0 if ($s =~ /\n/)
259 0 0 if ($s) { }
270 0 0 if ($self->{'REPLACE'} and $self->{'IgnoreOuter'}) { }
281 3 3 if (ref $subs eq 'Regexp') { }
2 1 elsif ($off < 1) { }
282 1 2 if ($off < 1) { }
283 1 0 if ($str =~ /$subs/) { }
287 2 0 if ($str =~ /$subs/g) { }
312 0 0 if ($ht eq '')
313 0 0 if (exists $hook->{'begin'}) { }
316 0 0 if ($ht eq 'string') { }
0 0 elsif ($ht eq 'be') { }
0 0 elsif ($ht eq 'regex') { }
0 0 elsif ($ht eq 'ht:re2') { }
318 0 0 unless $j != -1 and $j <= $i1
319 0 0 if $j == $i1 and $i2 <= $j + $pl2
324 0 0 unless $j != -1 and $j <= $i1
325 0 0 if ($hook->{'end'} ne '') { }
327 0 0 if -1 == $j2
329 0 0 if $j == $i1 and $i2 <= $j2
334 0 0 unless @args
336 0 0 unless $j < $i1
343 0 0 unless @args
345 0 0 unless $j < $i1
360 0 0 if ($self->{'data'} eq '') { }
367 0 0 if ($self->{'ttype'} == -2) { }
380 0 0 if (defined $self->{'OutDelimiters'})
382 0 0 if ($self->{'data'} =~ /^\Q$b1\E(\d*)\Q$b2\E.*?\Q$e1\E\1\Q$e2\E/s)
397 0 0 if ($ht eq 'string') { }
0 0 elsif ($hook->{'ht'} eq 'regex') { }
0 0 elsif ($hook->{'ht'} eq 'ht:re2') { }
0 0 elsif (@{$self->{'args'};}) { }
411 0 0 if $self->{'REPLACE'}
412 0 0 if $main::O eq ''
420 0 0 unless defined $code
423 0 0 if ($@)
438 0 0 if (defined $self->{'CodePreparation'} and $self->{'CodePreparation'})
448 0 0 if ($self->{'REPLACE'})
449 0 0 if ($main::O ne '')
455 0 0 if defined $self->{'OutDelimiters'}
457 0 0 if (index($out, $e) != -1)
458 0 0 if index($out, $e) == -1
459 0 0 if $i > 1000000
473 0 0 if (defined $self->{'CodePreparation'} and $self->{'CodePreparation'})
484 0 0 if ($self->{'REPLACE'}) { }
0 0 elsif ($main::O eq '') { }
491 0 0 if (index($main::O, $e) != -1)
492 0 0 if index($main::O, $e) == -1
493 0 0 if $i > 1000000
511 0 0 if $self->{'REPLACE'}
512 0 0 if $main::O eq ''
520 0 0 if $self->{'REPLACE'}
531 0 0 if ($self->{'REPLACE'})
542 0 0 if ($self->{'CurrentLoop'} > 1)
544 0 0 unless $data =~ /^.+/
545 0 0 unless $&
546 0 0 if $self->{'ForbidMacro'}{$&}
557 0 0 if ($self->{'CurrentLoop'} > 1)
559 0 0 unless $data =~ /^.+/
560 0 0 unless $&
561 0 0 if $self->{'ForbidMacro'}{$&}
568 0 0 unless ref $self eq 'Text::Starfish'
574 0 0 if ($self->{'CurrentLoop'} > 1)
576 0 0 unless $data =~ /^.+/
577 0 0 unless $&
578 0 0 if defined $self->{'ForbidMacro'}{$&}
584 0 0 unless ref $self eq 'Text::Starfish'
590 0 0 if ($self->{'CurrentLoop'} > 1)
592 0 0 unless $data =~ /^.+/
593 0 0 unless $&
594 0 0 if (defined $self->{'Macros'}{$&} or $self->{'ForbidMacro'}{$&})
603 0 0 unless ref $self eq 'Text::Starfish'
609 0 0 if ($self->{'CurrentLoop'} < 2 or $self->{'HideMacros'})
612 0 0 unless $data =~ /^.+/
613 0 0 unless $&
620 0 0 unless ref $self eq 'Text::Starfish'
626 0 0 if ($self->{'CurrentLoop'} < 2 or $self->{'HideMacros'})
629 0 0 unless $data =~ /^.+/
630 0 0 unless $&
631 0 0 unless defined $self->{'Macros'}{$&}
637 0 0 unless ref $self eq 'Text::Starfish'
643 0 0 if ($self->{'CurrentLoop'} < 2)
645 0 0 unless $data =~ /^.+/
646 0 0 unless $&
647 0 0 unless defined $self->{'Macros'}{$&}
653 0 0 unless ref $self eq 'Text::Starfish'
659 0 0 if ($self->{'CurrentLoop'} < 2)
661 0 0 unless $data =~ /^.+/
662 0 0 unless $&
663 0 0 unless defined $self->{'Macros'}{$&}
670 0 0 unless ref $self eq 'Text::Starfish'
676 0 0 unless $data =~ /^.+/
677 0 0 unless $&
683 0 0 unless ref $self eq 'Text::Starfish'
689 0 0 unless $data =~ /^.+/
690 0 0 unless $&
696 0 0 unless ref $self eq 'Text::Starfish'
702 0 0 unless $data =~ /^.+/
703 0 0 unless $&
709 0 0 unless ref $self eq 'Text::Starfish'
715 0 0 if ($self->{'CurrentLoop'} < 2)
716 0 0 unless $data =~ /^.+/
717 0 0 unless $&
718 0 0 unless defined $self->{'Macros'}{$&}
725 0 0 unless ref $self eq 'Text::Starfish'
731 0 0 unless $data =~ /^.+/
732 0 0 unless $&
735 0 0 if $self->{'ForbidMacro'}{$mn}
736 0 0 unless (defined $self->{'Macros'}{$mn})
742 0 0 unless ref $self eq 'Text::Starfish'
748 0 0 unless $data =~ /^.+/
749 0 0 unless $&
751 0 0 if $self->{'ForbidMacro'}{$mn}
752 0 0 unless (defined $self->{'Macros'}{$mn})
794 0 0 if (ref $self ne 'Text::Starfish')
796 0 0 if ($#_ == -1)
797 0 0 if (defined $self->{'STYLE'} and $self->{'STYLE'} ne '') { }
802 0 0 if ($f =~ /\.(html\.sfish|sf)$/i) { }
805 0 0 if ($f =~ /\.html?/i) { }
0 0 elsif ($f =~ /\.(?:la)?tex$/i) { }
0 0 elsif ($f =~ /\.java$/i) { }
0 0 elsif ($f =~ /^[Mm]akefile/) { }
0 0 elsif ($f =~ /\.ps$/i) { }
0 0 elsif ($f =~ /\.py$/i) { }
818 0 0 if ($s eq 'latex' or $s eq 'TeX')
819 0 0 if (defined $self->{'Style'} and $s eq $self->{'Style'})
839 0 0 if ($s eq 'perl') { }
0 0 elsif ($s eq 'makefile') { }
0 0 elsif ($s eq 'python') { }
0 0 elsif ($s eq 'java') { }
0 0 elsif ($s eq 'tex') { }
0 0 elsif ($s eq 'html.sfish') { }
0 0 elsif ($s eq 'html') { }
0 0 elsif ($s eq 'ps') { }
908 0 0 if (ref $self ne 'Text::Starfish')
913 0 0 if (ref $fun eq '')
914 0 0 if ($fun eq 'ignore') { }
0 0 elsif ($fun eq 'echo') { }
917 0 0 $lc eq '' ? :
924 0 0 if (ref $self ne 'Text::Starfish')
927 0 0 if $#_ > 0
933 0 0 if (ref $self ne 'Text::Starfish')
935 0 0 if scalar @_ != 4
942 0 0 if (ref $self ne 'Text::Starfish')
947 0 0 if ($ht eq 'string') { }
0 0 elsif ($ht eq 'be') { }
0 0 elsif ($ht eq 'regex') { }
0 0 elsif ($ht eq 'ht:re2') { }
953 0 0 if ($#_ > -1)
955 0 0 if ($f eq 'default') { }
0 0 elsif ($f eq 'ignore') { }
0 0 elsif ($f eq 'echo') { }
0 0 elsif (ref $f eq 'CODE') { }
965 0 0 if ($self->{'REPLACE'})
978 0 0 if $@
984 0 0 if (ref $replace eq '' and $replace eq 'comment') { }
0 0 elsif (ref $replace eq 'CODE') { }
994 0 0 unless ref $replace eq 'CODE'
1004 0 0 if ($#_ == 2) { }
0 0 elsif ($#_ == 1 and ref $_[0] eq 'Regexp') { }
1013 0 0 if (ref $self ne 'Text::Starfish')
1017 0 0 if ($ht eq 'be') { }
1021 0 0 if ($h->{'begin'} eq $b and $h->{'end'} eq $e) { }
1040 0 0 unless ref $f eq 'CODE'
1041 0 0 unless (defined $self->{'Final'})
1048 0 0 if $self->{'CurrentLoop'} > 1
1049 0 0 if $self->{'Loops'} < 2
1109 0 0 unless $f =~ /\b$l=(.*(?:(?<=\\)\n.*)*)/
1130 0 0 if ($& eq "\n") { }
1143 0 0 unless open F, "<$f"
1146 0 0 wantarray ? :
1152 0 0 unless open F, ">$f"
1153 0 0 unless @_
1161 0 0 unless open F, ">>$f"
1162 0 0 unless @_
1177 0 0 if ($arg =~ /^file=/)
1178 0 0 unless open F, $f
1185 0 0 if ($arg =~ /^([ \t\r]*(#.*)?\n)+/)
1186 0 0 if $arg eq ''
1187 0 0 if ($arg =~ /([ \t\r]*\n){2,}/) { }
1191 0 0 if ($record =~ /^[ \t]*#.*\n/)
1193 0 0 unless $record =~ /^[ \t]*([^\n:]*?)[ \t]*:/
1196 0 0 if $k eq ''
1198 0 0 if ($record =~ /^(.*?)\\(\r?\n)/) { }
0 0 elsif ($record =~ /^.*?\r?\n[ \t]/) { }
0 0 elsif ($record =~ /^(.*?)\r?\n/) { }
1203 0 0 if (exists $r->{$k})
1212 0 0 wantarray ? :
1218 0 0 @_ ? :
1219 0 0 if ($self->{'Loops'} < 2)
1224 0 0 @_ ? :
1229 0 0 @_ ? :
1239 0 0 unless -e 'starfish.conf'
1246 0 0 unless chdir $d
1250 0 0 unless chdir $currdir
1264 0 0 if grep {$_ eq $d;} @Text::Starfish::DirGenerateIfNeeded