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
111 0 0 if (/^-replace$/) { }
0 0 elsif (/^-noreplace$/) { }
0 0 elsif (/^-require$/) { }
0 0 elsif (not /^-/ and $infile eq '') { }
121 0 0 if ($sf->{'INFILE'} eq '' or not -r $sf->{'INFILE'})
122 0 0 if ($require)
134 0 0 if (defined $self->{'REPLACE'} and not defined $self->{'OUTFILE'})
148 0 0 exists $self->{'OUTFILE'} ? :
151 0 0 if (not defined $self->{'OUTFILE'}) { }
0 0 elsif ($FileCount > 1) { }
0 0 elsif (not -f $self->{'OUTFILE'}) { }
171 0 0 if ($outfileExternal ne '' and $outfileExternal ne $self->{'OUTFILE'})
176 0 0 if ($FileCount == 1 and defined $self->{'OUTFILE'})
178 0 0 if (not -f $self->{'OUTFILE'}) { }
0 0 elsif (defined $self->{'NEW_FILE_MODE'}) { }
181 0 0 if (defined $self->{'NEW_FILE_MODE'}) { }
190 0 0 if ($ExistingText ne $self->{'Out'}) { }
0 0 elsif (defined $self->{'NEW_FILE_MODE'}) { }
191 0 0 if (defined $self->{'OUTFILE'}) { }
197 0 0 if (($mode & 128) == 0 and defined $self->{'NEW_FILE_MODE'}) { }
199 0 0 if ($FileCount == 1) { }
203 0 0 if ($FileCount == 1) { }
209 0 0 if defined $self->{'NEW_FILE_MODE'}
213 0 0 if (defined $self->{'OUTFILE'}) { }
230 0 0 if ($self->{'ttype'} > -1) { }
236 0 0 if ($self->{'CurrentLoop'} < $self->{'Loops'})
238 0 0 if ($self->{'REPLACE'})
242 0 0 if ($savedcontent ne $self->{'Out'})
248 0 0 if (defined $self->{'Final'})
255 0 0 if (defined $self->{'macrosdefined'})
259 0 0 if ($s =~ /\n/)
261 0 0 if ($s) { }
272 0 0 if ($self->{'REPLACE'} and $self->{'IgnoreOuter'}) { }
283 3 3 if (ref $subs eq 'Regexp') { }
2 1 elsif ($off < 1) { }
284 1 2 if ($off < 1) { }
285 1 0 if ($str =~ /$subs/) { }
289 2 0 if ($str =~ /$subs/g) { }
314 0 0 if ($ht eq '')
315 0 0 if (exists $hook->{'begin'}) { }
318 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') { }
320 0 0 unless $j != -1 and $j <= $i1
321 0 0 if $j == $i1 and $i2 <= $j + $pl2
326 0 0 unless $j != -1 and $j <= $i1
327 0 0 if ($hook->{'end'} ne '') { }
329 0 0 if -1 == $j2
331 0 0 if $j == $i1 and $i2 <= $j2
336 0 0 unless @args
338 0 0 unless $j < $i1
345 0 0 unless @args
347 0 0 unless $j < $i1
362 0 0 if ($self->{'data'} eq '') { }
369 0 0 if ($self->{'ttype'} == -2) { }
382 0 0 if (defined $self->{'OutDelimiters'})
384 0 0 if ($self->{'data'} =~ /^\Q$b1\E(\d*)\Q$b2\E.*?\Q$e1\E\1\Q$e2\E/s)
399 0 0 if ($hook->{'ht'} eq 'string') { }
0 0 elsif ($hook->{'ht'} eq 'regex') { }
0 0 elsif ($hook->{'ht'} eq 'ht:re2') { }
0 0 elsif (@{$self->{'args'};}) { }
413 0 0 if $self->{'REPLACE'}
414 0 0 if $main::O eq ''
422 0 0 unless defined $code
425 0 0 if ($@)
440 0 0 if (defined $self->{'CodePreparation'} and $self->{'CodePreparation'})
450 0 0 if ($self->{'REPLACE'})
451 0 0 if ($main::O ne '')
457 0 0 if defined $self->{'OutDelimiters'}
459 0 0 if (index($out, $e) != -1)
460 0 0 if index($out, $e) == -1
461 0 0 if $i > 1000000
475 0 0 if (defined $self->{'CodePreparation'} and $self->{'CodePreparation'})
486 0 0 if ($self->{'REPLACE'}) { }
0 0 elsif ($main::O eq '') { }
493 0 0 if (index($main::O, $e) != -1)
494 0 0 if index($main::O, $e) == -1
495 0 0 if $i > 1000000
513 0 0 if $self->{'REPLACE'}
514 0 0 if $main::O eq ''
522 0 0 if $self->{'REPLACE'}
533 0 0 if ($self->{'REPLACE'})
544 0 0 if ($self->{'CurrentLoop'} > 1)
546 0 0 unless $data =~ /^.+/
547 0 0 unless $&
548 0 0 if $self->{'ForbidMacro'}{$&}
559 0 0 if ($self->{'CurrentLoop'} > 1)
561 0 0 unless $data =~ /^.+/
562 0 0 unless $&
563 0 0 if $self->{'ForbidMacro'}{$&}
570 0 0 unless ref $self eq 'Text::Starfish'
576 0 0 if ($self->{'CurrentLoop'} > 1)
578 0 0 unless $data =~ /^.+/
579 0 0 unless $&
580 0 0 if defined $self->{'ForbidMacro'}{$&}
586 0 0 unless ref $self eq 'Text::Starfish'
592 0 0 if ($self->{'CurrentLoop'} > 1)
594 0 0 unless $data =~ /^.+/
595 0 0 unless $&
596 0 0 if (defined $self->{'Macros'}{$&} or $self->{'ForbidMacro'}{$&})
605 0 0 unless ref $self eq 'Text::Starfish'
611 0 0 if ($self->{'CurrentLoop'} < 2 or $self->{'HideMacros'})
614 0 0 unless $data =~ /^.+/
615 0 0 unless $&
622 0 0 unless ref $self eq 'Text::Starfish'
628 0 0 if ($self->{'CurrentLoop'} < 2 or $self->{'HideMacros'})
631 0 0 unless $data =~ /^.+/
632 0 0 unless $&
633 0 0 unless defined $self->{'Macros'}{$&}
639 0 0 unless ref $self eq 'Text::Starfish'
645 0 0 if ($self->{'CurrentLoop'} < 2)
647 0 0 unless $data =~ /^.+/
648 0 0 unless $&
649 0 0 unless defined $self->{'Macros'}{$&}
655 0 0 unless ref $self eq 'Text::Starfish'
661 0 0 if ($self->{'CurrentLoop'} < 2)
663 0 0 unless $data =~ /^.+/
664 0 0 unless $&
665 0 0 unless defined $self->{'Macros'}{$&}
672 0 0 unless ref $self eq 'Text::Starfish'
678 0 0 unless $data =~ /^.+/
679 0 0 unless $&
685 0 0 unless ref $self eq 'Text::Starfish'
691 0 0 unless $data =~ /^.+/
692 0 0 unless $&
698 0 0 unless ref $self eq 'Text::Starfish'
704 0 0 unless $data =~ /^.+/
705 0 0 unless $&
711 0 0 unless ref $self eq 'Text::Starfish'
717 0 0 if ($self->{'CurrentLoop'} < 2)
718 0 0 unless $data =~ /^.+/
719 0 0 unless $&
720 0 0 unless defined $self->{'Macros'}{$&}
727 0 0 unless ref $self eq 'Text::Starfish'
733 0 0 unless $data =~ /^.+/
734 0 0 unless $&
737 0 0 if $self->{'ForbidMacro'}{$mn}
738 0 0 unless (defined $self->{'Macros'}{$mn})
744 0 0 unless ref $self eq 'Text::Starfish'
750 0 0 unless $data =~ /^.+/
751 0 0 unless $&
753 0 0 if $self->{'ForbidMacro'}{$mn}
754 0 0 unless (defined $self->{'Macros'}{$mn})
796 0 0 if (ref $self ne 'Text::Starfish')
798 0 0 if ($#_ == -1)
799 0 0 if (defined $self->{'STYLE'} and $self->{'STYLE'} ne '') { }
804 0 0 if ($f =~ /\.(html\.sfish|sf)$/i) { }
807 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) { }
820 0 0 if ($s eq 'latex' or $s eq 'TeX')
821 0 0 if (defined $self->{'Style'} and $s eq $self->{'Style'})
841 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') { }
910 0 0 if (ref $self ne 'Text::Starfish')
915 0 0 if (ref $fun eq '')
916 0 0 if ($fun eq 'ignore') { }
0 0 elsif ($fun eq 'echo') { }
919 0 0 $lc eq '' ? :
926 0 0 if (ref $self ne 'Text::Starfish')
929 0 0 if $#_ > 0
935 0 0 if (ref $self ne 'Text::Starfish')
937 0 0 if scalar @_ != 4
944 0 0 if (ref $self ne 'Text::Starfish')
949 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') { }
955 0 0 if ($#_ > -1)
957 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') { }
967 0 0 if ($self->{'REPLACE'})
980 0 0 if $@
986 0 0 if (ref $replace eq '' and $replace eq 'comment') { }
0 0 elsif (ref $replace eq 'CODE') { }
996 0 0 unless ref $replace eq 'CODE'
1006 0 0 if ($#_ == 2) { }
0 0 elsif ($#_ == 1 and ref $_[0] eq 'Regexp') { }
1015 0 0 if (ref $self ne 'Text::Starfish')
1019 0 0 if ($ht eq 'be') { }
1023 0 0 if ($h->{'begin'} eq $b and $h->{'end'} eq $e) { }
1042 0 0 unless ref $f eq 'CODE'
1043 0 0 unless (defined $self->{'Final'})
1050 0 0 if $self->{'CurrentLoop'} > 1
1051 0 0 if $self->{'Loops'} < 2
1111 0 0 unless $f =~ /\b$l=(.*(?:(?<=\\)\n.*)*)/
1132 0 0 if ($& eq "\n") { }
1145 0 0 unless open F, "<$f"
1148 0 0 wantarray ? :
1154 0 0 unless open F, ">$f"
1155 0 0 unless @_
1163 0 0 unless open F, ">>$f"
1164 0 0 unless @_
1179 0 0 if ($arg =~ /^file=/)
1180 0 0 unless open F, $f
1187 0 0 if ($arg =~ /^([ \t\r]*(#.*)?\n)+/)
1188 0 0 if $arg eq ''
1189 0 0 if ($arg =~ /([ \t\r]*\n){2,}/) { }
1193 0 0 if ($record =~ /^[ \t]*#.*\n/)
1195 0 0 unless $record =~ /^[ \t]*([^\n:]*?)[ \t]*:/
1198 0 0 if $k eq ''
1200 0 0 if ($record =~ /^(.*?)\\(\r?\n)/) { }
0 0 elsif ($record =~ /^.*?\r?\n[ \t]/) { }
0 0 elsif ($record =~ /^(.*?)\r?\n/) { }
1205 0 0 if (exists $r->{$k})
1214 0 0 wantarray ? :
1220 0 0 @_ ? :
1221 0 0 if ($self->{'Loops'} < 2)
1226 0 0 @_ ? :
1231 0 0 @_ ? :
1241 0 0 unless -e 'starfish.conf'
1248 0 0 unless chdir $d
1252 0 0 unless chdir $currdir
1266 0 0 if grep {$_ eq $d;} @Text::Starfish::DirGenerateIfNeeded