Branch Coverage

blib/lib/PDF/API2/Content.pm
Criterion Covered Total %
branch 209 372 56.1


line true false branch
70 6 0 if ($self->{'-docompress'} and $self->{'Filter'})
197 0 15 if (defined $opts{'-matrix'})
203 9 6 if (defined $opts{'skew'})
206 9 6 if (defined $opts{'scale'})
209 9 6 if (defined $opts{'rotate'})
212 12 3 if (defined $opts{'translate'})
217 0 15 if ($opts{'-point'})
235 0 16 if $options{'repeat'}
238 1 15 if $options{'relative'}
242 14 46 if (exists $options{"-" . $option})
264 4 4 if (exists $options{"-" . $option})
269 2 0 $options{'skew'} ? :
272 2 0 $options{'scale'} ? :
278 2 0 $options{'translate'} ? :
318 26 0 if (scalar @_)
320 3 23 if ($self->_in_text_object) { }
330 3 23 if ($self->_in_text_object) { }
361 0 11 if ($self->_in_text_object)
385 0 11 if ($self->_in_text_object)
456 0 2 if ($self->{' graphics'} and not @_)
461 0 2 if $style eq "butt"
462 1 1 if $style eq "round"
463 0 2 if $style eq "square"
465 0 2 unless ($style >= 0 and $style <= 2)
466 0 0 if ($self->{' graphics'}) { }
516 0 2 if ($self->{' graphics'} and not @_)
521 0 2 if $style eq "miter"
522 0 2 if $style eq "round"
523 1 1 if $style eq "bevel"
525 0 2 unless ($style >= 0 and $style <= 2)
526 0 0 if ($self->{' graphics'}) { }
607 7 3 unless (@options)
611 3 0 if ($options[0] =~ /^\d/)
618 0 0 if ($options{'-pattern'})
621 0 0 if ($options{'-shift'})
627 0 0 if (exists $options{'-full'} or exists $options{'-clear'})
713 0 107 if ($self->_in_text_object) { }
744 0 96 if ($self->_in_text_object) { }
768 0 2 if ($self->_in_text_object) { }
788 0 1 if ($self->_in_text_object) { }
808 0 2 unless (@_ % 2 == 0)
851 0 78 if ($self->_in_text_object) { }
901 68 76 if (abs $beta - $alpha > 30) { }
939 3 1 if $move
980 0 4 if $x < 0 and $y > 0
981 0 4 if $x < 0 and $y < 0
985 1 3 if $spf and $spf > 0
991 1 3 if $larc and $larc > 0
997 1 3 if ($spf and $spf > 0)
1011 1 3 if $move
1019 1 35 if (scalar @points == 0) { }
1088 1 1 if ($x2 < $x1)
1093 0 2 if ($y2 < $y1)
1223 23 3 if ($clr[0] =~ /^[a-z\#\!]+/) { }
2 1 elsif ($clr[0] =~ /^[\%]+/) { }
0 1 elsif ($clr[0] =~ /^[\$\&]/) { }
0 1 elsif (scalar @clr == 1 and ref $clr[0]) { }
0 1 elsif (scalar @clr == 1) { }
1 0 elsif (scalar @clr > 1 and ref $clr[0]) { }
0 0 elsif (scalar @clr == 2) { }
0 0 elsif (scalar @clr == 3) { }
0 0 elsif (scalar @clr == 4) { }
1227 14 9 $sf ? :
1232 1 1 $sf ? :
1237 0 0 unless (defined $self->resource("ColorSpace", "LabS"))
1245 0 0 $sf ? :
0 0 $sf ? :
1249 0 0 $sf ? :
0 0 $sf ? :
1253 0 0 $sf ? :
1259 0 1 $sf ? :
0 1 $sf ? :
1264 0 0 $sf ? :
0 0 $sf ? :
1268 0 0 $sf ? :
1272 0 0 $sf ? :
1281 0 15 if (ref($clrs[0]) =~ /^PDF::API2::Resource::ColorSpace/) { }
0 15 elsif (ref($clrs[0]) =~ /^PDF::API2::Resource::Pattern/) { }
1296 15 0 if (@_)
1305 1 10 if (ref($clrs[0]) =~ /^PDF::API2::Resource::ColorSpace/) { }
0 10 elsif (ref($clrs[0]) =~ /^PDF::API2::Resource::Pattern/) { }
1319 11 0 if (@_)
1375 1 2 if (@_ == 2) { }
1377 1 0 if (($options{'rule'} // "nonzero") eq "even-odd")
1386 2 1 $even_odd ? :
1406 1 3 if (@_ == 2) { }
1408 1 0 if (($options{'rule'} // "nonzero") eq "even-odd")
1417 2 2 $even_odd ? :
1436 1 2 if (@_ == 2) { }
1438 1 0 if (($options{'rule'} // "nonzero") eq "even-odd")
1447 2 1 $even_odd ? :
1506 0 0 if ($object->isa('PDF::API2::Resource::XObject::Image')) { }
1530 0 8 if (defined $img->{'Metadata'})
1534 8 0 defined $w ? :
1548 0 8 if (defined $img->{'Metadata'})
1558 2 0 if (defined $s) { }
1597 1 17 if ($font->isvirtual) { }
1606 1 18 unless ($size)
1621 1 17 if ($font->isvirtual) { }
1651 3 1 if (defined $spacing)
1683 15 10 if (defined $spacing)
1707 2 12 if (defined $scale)
1737 11 35 if (defined $leading)
1779 1 0 if (defined $mode)
1805 1 0 if (defined $distance)
1816 0 0 if (@_) { }
1819 0 0 unless $state{$k}
1822 0 0 if ($state{'font'} and $state{'fontsize'})
1825 0 0 if ($state{'textmatrix'})
1832 0 0 if ($state{'fillcolor'})
1835 0 0 if ($state{'strokecolor'})
1878 0 59 if (defined $x and not defined $y)
1882 1 58 if (defined $x)
1905 2 1 if (defined $offset) { }
1930 22 1 if ($leading or not $self->{' fontsize'}) { }
2034 0 0 if (ref $underline eq 'ARRAY') { }
2040 0 0 if @underline % 2
2052 0 0 if (ref $thickness)
2055 0 0 if ($distance eq "auto")
2058 0 0 if ($thickness eq "auto")
2078 1 29 unless ($self->{' fontset'})
2079 1 0 unless (defined $self->{' font'} and $self->{' fontsize'})
2087 10 19 if (exists $opts{'-indent'})
2090 0 29 if (exists $opts{'-underline'})
2096 12 17 if (defined $opts{'align'})
2097 6 6 if ($opts{'align'} eq 'left') { }
3 3 elsif ($opts{'align'} eq 'center') { }
3 0 elsif ($opts{'align'} eq 'right') { }
2111 12 17 if (defined $opts{'indent'})
2117 12 17 if (defined $opts{'indent'}) { }
2130 0 29 if (defined $opts{'underline'})
2166 1 0 if $space_count
2179 12 100 if $self->advancewidth(join($", @line)) > $width
2181 12 7 if (scalar @line > 1 and $self->advancewidth(join($", @line)) > $width)
2218 4 4 if ($ret)
2219 4 0 if $space_count
2226 3 1 if ($opts{'align-last'})
2227 0 3 unless ($opts{'align-last'} =~ /^(left|center|right|justified)$/)
2232 1 3 if ($align_last eq 'left') { }
1 2 elsif ($align_last eq 'center') { }
1 1 elsif ($align_last eq 'right') { }
2242 1 0 if $space_count
2291 6 4 if (exists $opts{'-align'})
2294 3 7 if (exists $opts{'-align-last'})
2297 0 10 if (exists $opts{'-underline'})
2302 0 10 unless ($leading)
2307 1 9 if ($text =~ /\n/)
2311 0 3 if (length $overflow)
2317 1 2 unless (length $line)
2324 1 1 if length $line
2327 0 1 if wantarray
2334 2 19 if $height < 0
2337 8 11 if ($align eq 'justified' or $align eq 'justify') { }
2 9 elsif ($align eq 'right') { }
2 7 elsif ($align eq 'center') { }
2352 2 7 if wantarray
2366 0 0 if $opts{'-rotate'}
2369 0 0 if ($wastext)
2378 0 0 if ($opts{'-color'})
2379 0 0 ref $opts{'-color'} ? :
2382 0 0 if ($opts{'-strokecolor'})
2385 0 0 ref $opts{'-strokecolor'} ? :
2391 0 0 if $opts{'-charspace'}
2392 0 0 if $opts{'-hscale'}
2393 0 0 if $opts{'-wordspace'}
2394 0 0 if $opts{'-render'}
2397 0 0 if ($opts{'-right'} or $align =~ /^r/i) { }
0 0 elsif ($opts{'-center'} or $align =~ /^c/i) { }
2410 0 0 if ($wastext)
2439 0 183 unless defined $text and length $text
2442 0 183 if (exists $opts{'size'})
2445 0 183 if (exists $opts{'character_spacing'})
2448 0 183 if (exists $opts{'word_spacing'})
2453 913 2 unless defined $opts{$k}
2476 0 0 if (defined $obj) { }
2497 0 0 if (@_)
2498 0 0 unless ($self->{' poststream'} =~ /\s$/)
2508 778 0 if (@_)
2509 129 649 unless ($self->{' stream'} =~ /\s$/)
2533 19 0 unless ($self->_in_text_object)
2561 15 108 if ($self->_in_text_object)
2571 29 2 if ($self->{' apipage'}) { }
2580 0 2 if ref($dict) =~ /Objind$/
2583 0 2 if ref($dict->{$type}) =~ /Objind$/
2584 2 0 if (defined $obj) { }
2588 0 2 if ($force) { }