Condition Coverage

blib/lib/PDF/Builder/Basic/PDF/File.pm
Criterion Covered Total %
condition 65 158 41.1


and 3 conditions

line !l l&&!r l&&r condition
249 18 0 0 defined $options{'-diags'} and not defined $options{'diags'}
280 0 18 0 defined $2 and length $2 > 0
333 22 4 5 defined $trailer_version && $trailer_version > $header_version
341 3 0 0 defined $opts{'-silent'} and not defined $opts{'silent'}
396 6 0 0 defined $opts{'-silent'} and not defined $opts{'silent'}
450 5 0 0 defined $opts{'-silent'} and not defined $opts{'silent'}
460 3 2 0 defined $old_version and $old_version > $version
525 5895 342 2546 &blessed($item) and $item->can("release")
652 171 0 0 defined $self->{' newroot'} && $self->{' newroot'} ne ''
670 171 0 0 $^O eq "MacOS" and not ref $self->{' fname'}
742 151 0 11 $str =~ s/^stream(?:(?:\015\012)|\012|\015)// and $result->{'Length'}->val != 0
763 96 28 38 defined $result->{'Type'} and defined $PDF::Builder::Basic::PDF::File::types{$result->{'Type'}->val}
897 2 364 4 $update and $str =~ /^$re_whitespace*$/s || $str =~ /^$re_whitespace+[0-9]+$re_whitespace*$/s
1029 1351 14 0 defined $self->{' free'} and scalar @{$self->{' free'};} > 0
1046 1366 0 0 defined $i and $i != 0
1233 0 0 0 $obj->isa("PDF::Builder::Basic::PDF::Dict") and $obj->{'Linearized'}
1408 21 0 0 defined $options{'-diags'} and not defined $options{'diags'}
1469 23 0 0 $entry_size != 20 and $options{'diags'} == 1
1480 23 0 132 $xnum-- > 0 and $buf =~ /^$PDF::Builder::Basic::PDF::File::ws_char*(\d+)$PDF::Builder::Basic::PDF::File::ws_char+(\d+)$PDF::Builder::Basic::PDF::File::ws_char+([nf])$PDF::Builder::Basic::PDF::File::ws_char*$PDF::Builder::Basic::PDF::File::cr/
1506 114 18 0 $xmin == 0 and $subsection_count > 1
132 0 0 $xmin == 0 and $subsection_count > 1 and $options{'diags'} == 1
1526 0 0 0 $subsection_count == 1 and exists $xlist->{'1'}
1529 0 0 0 $xlist->{'1'}[0] == 0 and $xlist->{'1'}[1] == 65535
0 0 0 $xlist->{'1'}[0] == 0 and $xlist->{'1'}[1] == 65535 and $xlist->{'1'}[2] eq "f"
1565 18 0 0 $xlist->{$_}[1] <= 0 and $options{'diags'} == 1
1571 114 0 0 $xlist->{$_}[0] <= 0 and $options{'diags'} == 1
1574 114 0 0 $xlist->{$_}[1] < 0 and $options{'diags'} == 1
1585 18 0 0 $xlist->{'0'}[1] != 65535 and $options{'diags'} == 1
1599 0 18 0 $next_free and exists $xlist->{$next_free}
1600 18 0 0 scalar @free_list and $options{'diags'} == 1
1605 18 0 0 not $buf =~ /^\s*trailer\b/i and $options{'diags'} == 1
1658 26 0 0 $cols[0] > 2 and $options{'diags'} == 1
1684 18 0 3 defined $tdict->{'Prev'} and $tdict->{'Prev'}->val != 0
1750 1074 0 0 defined $freelist[$k] and defined $xref
1074 0 0 defined $freelist[$k] and defined $xref and "$freelist[$k]" eq "$xref"
1776 179 0 0 exists $tdict->{'Type'} and $tdict->{'Type'}->val eq "XRef"
1798 0 0 0 $_->[1] == 65535 and $_->[2] eq "f"

or 2 conditions

line l !l condition
264 0 0 'IO::File'->new(($update ? '+' : '') . "<$filename") || (return)
562 8 0 $self->{' version'} || 1.4
623 0 0 'IO::File'->new(">$filename") || die("Unable to open $filename for writing")
628 171 0 $self->{' version'} // "1.4"
931 86 0 $self->read_objnum($objind->{' objnum'}, $objind->{' objgen'}, %opts) || (return)
951 94 0 $self->locate_obj($num, $gen) || (return)
1678 21 0 $xmin ||= 0

or 3 conditions

line l !l&&r !l&&!r condition
657 0 171 0 $self->{'Size'} || PDFNum(1)
897 4 2 362 $str =~ /^$re_whitespace*$/s || $str =~ /^$re_whitespace+[0-9]+$re_whitespace*$/s
1053 0 0 0 $self->test_obj($i, $ng) || $self->add_obj('PDF::Builder::Basic::PDF::Objind'->new, $i, $ng)
1210 0 0 0 $nl < $minl or $mini == 0
1226 0 0 0 not $res or $res->is_obj($outpdf)
1293 11 0 0 $str =~ /endstream/ or $fh->eof
1299 3189 42 128 $str =~ /$PDF::Builder::Basic::PDF::File::cr/ or $fh->eof
1306 1 0 0 $str =~ /$PDF::Builder::Basic::PDF::File::cr/ or $fh->eof
1483 132 0 0 $buf =~ /^\d{10} \d{5} [nf]$PDF::Builder::Basic::PDF::File::cr/ or $entry_format_error
1523 18 0 0 exists $xlist->{'0'} or $xrefListEmpty
1740 179 12 1062 $i > $#xreflist or $self->{' objects'}{$xreflist[$i]->uid}[0] != $j + 1