Branch Coverage

blib/lib/PostScript/File.pm
Criterion Covered Total %
branch 206 322 63.9


line true false branch
55 22 0 unless defined $t1ascii
57 22 0 unless defined $ttftotype42
125 680 635 if defined $_
130 1 44 if (@options == 1) { }
169 1 44 if $$opt{'png'}
181 2 42 if ($$o{'debug'})
207 2 42 defined $$opt{'order'} ? :
224 2 42 if $$opt{'need_fonts'}
226 42 2 if _def($$opt{'newpage'}, 1)
238 2 43 $$o{'pagecount'} ? :
2 45 defined $page ? :
258 6 98 if (my $use_functions = $$o{'use_functions'})
265 6 98 if ($$o{'reencode'})
332 6 72 if $font eq 'Symbol'
339 7 97 $$o{'eps'} ? :
340 7 97 if ($$o{'eps'})
343 3 101 if ($$o{'headings'})
352 2 1 unless $$o{'eps'}
358 10 94 if $landscape
368 10 94 if ($clipping)
370 3 7 if $clipcmd eq 'stroke'
389 65 39 if ($$o{'errors'})
426 2 102 if ($$o{'debug'})
592 0 104 if defined $$o{'debug'} and not $$o{'debug'}
611 64 24 if ($landscapefn or $clipfn or $errorfn or $debugfn)
626 4 100 if not defined $title and defined $filename
629 5 99 if $$o{'Comments'}
630 10 94 $$o{'landscape'} ? :
631 65 39 if $docNeeded
632 86 18 if $docSupplied
633 4 100 if defined $title
634 0 104 if $$o{'version'}
635 7 97 if not $$o{'eps'} and $$o{'pagecount'} > 1
636 5 99 if not $$o{'eps'} and $$o{'order'}
637 0 104 if $$o{'extensions'}
638 0 104 if $$o{'langlevel'}
641 6 98 if $$o{'Preview'}
643 5 99 if $$o{'Defaults'}
657 16 88 if $setup
669 39 65 unless %$needed
674 65 25 if ($type eq 'font')
679 0 90 unless %{$$needed{$type};}
686 12 181 if length $list[-1] and length($resource) + length($list[-1]) >= $maxLen
704 5 99 if $$o{'encoding'}
708 10 94 if $trailer
720 32 72 if @_ > 1 and not $fh
723 2 102 if (defined $$o{'debug'}) { }
726 2 0 if ($$o{'debug'} >= 2)
746 7 97 if ($$o{'eps'}) { }
751 1 6 if (defined $$o{'filename'})
752 0 1 $$o{'pagecount'} > 1 ? :
754 0 1 $$o{'Preview'} ? :
0 1 defined $$o{'file_ext'} ? :
762 0 7 if $$o{'pagelandsc'}[$p]
763 0 7 if $$o{'pageclip'}[$p]
773 0 7 wantarray ? :
784 0 3 defined $$o{'file_ext'} ? :
3 94 if defined $psfile
791 10 94 if ($$o{'pagelandsc'}[$p]) { }
798 10 94 $$o{'pageclip'}[$p] ? :
833 28 0 unless ($verbatim)
855 24 87 if ($comment =~ /\./)
869 28 76 if (defined $filename) { }
871 24 4 if ($outfile)
876 0 4 unless open $outfile, '>', $filename
910 4 72 defined $filename && length $filename ? :
938 2 42 if (not $height and $paper =~ /^(\d+(?:\.\d+)?)\s*x\s*(\d+(?:\.\d+)?)$/i)
944 44 0 if ($height)
948 0 44 if ($$o{'landscape'}) { }
970 1 43 if (defined $width and $width + 0)
973 0 1 if ($$o{'landscape'}) { }
990 1 43 if (defined $height and $height + 0)
993 0 1 if ($$o{'landscape'}) { }
1012 44 0 unless defined $$o{'landscape'}
1013 4 40 if ($$o{'landscape'} != $landscape)
1116 39 5 unless $encoding
1118 1 4 if ($encoding eq 'ISOLatin1Encoding')
1123 0 4 unless $$o{'reencode'} = $encoding_name{$encoding}
1127 0 4 unless $$o{'encoding'} = &Encode::find_encoding($encoding)
1145 9 675 if ($encoding and &Encode::is_utf8($_[0])) { }
1147 0 22 unless ($encode_char{$_[0]})
1148 0 0 if ($_[0] < 256) { }
1169 80 4 if ($encoding and not &Encode::is_utf8($_[0])) { }
1172 57 23 if $_[1]
1183 27 11 if ($_[0] =~ /-/) { }
1215 0 0 unless ($encoding)
1216 0 0 if ($font eq 'Symbol') { }
0 0 elsif ($$o{'reencode'} and $font =~ s/\Q$$o{'font_suffix'}\E$//) { }
1264 27 17 if (not defined $strip) { }
1267 0 44 unless defined($$o{'strip'} = $strip_re{$strip})
1284 26 529 if (@_ > 1) { }
1286 0 26 unless defined($re = $strip_re{$strip})
1292 0 555 unless $re
1297 0 555 unless defined $_
1300 61 33268 if /\G<~[^~]*~>/cg or /\G\( (?: [^\\)]+ | \\. )* \)/cgsx
1303 4828 28440 if (s/$re//m) { }
1308 0 28440 if pos $_ == $pos
1326 0 0 @_ == 2 ? :
1328 0 0 unless defined $$o{'pagelandsc'}[$p]
1329 0 0 if ($$o{'pagelandsc'}[$p] != $landscape)
1347 0 0 @_ == 2 ? :
1401 0 0 unless ($$o{'langlevel'} || 0) >= $level
1419 51 0 if defined $y1
1445 0 0 @_ == 5 ? :
1446 0 0 if (@_ == 4)
1471 0 0 @_ == 5 ? :
1472 0 0 if (@_ == 4)
1475 0 0 if ($$o{'pagelandsc'}[$p]) { }
1504 113 0 if ($page)
1507 113 7 if $here eq $page
1552 4 0 if defined $entry
1564 2 0 if (defined $entry)
1581 4 0 if defined $entry
1607 0 4 unless defined $suptype or $add_resource_accepts{lc $type}
1610 4 0 unless (defined $suptype)
1616 4 0 if (defined $resource)
1619 4 0 if $suptype
1625 2 2 if ($suptype eq 'font')
1630 0 4 if defined $params and length $params
1651 6 0 if (defined $name and defined $entry)
1652 4 2 if $o->has_procset($name)
1703 8 0 unless index($$o{'DocSupplied'}, $supplied) >= 0
1707 0 8 unless open my $in, '<:raw', $filename
1712 4 4 if ($content =~ /^\xC5\xD0\xD3\xC6/)
1733 0 0 unless ($type)
1734 0 0 unless $filename =~ m[\.([^\\/.]+)$]
1740 0 0 if ($type eq 'PFA') { }
0 0 elsif ($type eq 'PFB') { }
0 0 elsif ($type eq 'TTF') { }
1741 0 0 unless open $in, '<:raw', $filename
1743 0 0 unless open $in, '-|:raw', $t1ascii, $filename
1746 0 0 unless open $in, '-|:raw', $ttftotype42, $filename
1757 0 0 unless $content =~ m[/FontName\s+/(\S+)\s+def\b]
1772 0 81 unless exists $add_resource_accepts{$type}
1780 2 87 ref $res ? :
1795 4 0 if defined $entry
1808 4 0 if defined $entry
1822 0 27 @_ == 2 ? :
1824 0 27 if ($page)
1826 0 0 if ($ord == $$o{'p'} and $page ne $$o{'page'}[$ord]) { }
1846 4 0 if defined $entry
1859 4 0 if defined $entry
1881 480 25 if ($$o{'strip_type'} ne 'none') { }
25 0 elsif ($text =~ /^([ \t]+)/) { }
1920 8 0 unless defined $create
1922 0 8 if (not defined $filename && length $filename) { }
1927 8 0 unless ('File::Spec'->file_name_is_absolute($filename))
1928 8 0 if (defined $dir) { }
1931 0 8 unless 'File::Spec'->file_name_is_absolute($dir)
1945 0 32 unless -d $path
1949 0 8 if ($create)
1950 0 0 unless (-e $filename)
1951 0 0 unless open my $file, '>', $filename
1964 0 16 unless defined $dir
1965 0 0 $1 ? :
1980 0 0 if (ref $arg eq 'ARRAY') { }
1997 40 13 if @_ > 1
2002 11 13 if ref $o and $$o{'auto_hyphen'} and $string =~ /-/
2009 50 3 unless $nowrap
2019 117 0 if @_ > 1
2023 115 2 if $string =~ m[^[-+_./*A-Za-z0-9]+\z]