Branch Coverage

blib/lib/SVGPDF/Element.pm
Criterion Covered Total %
branch 85 152 55.9


line true false branch
11 0 30 if @_
12 0 450 if @_
13 0 192 if @_
14 0 0 if @_
15 0 112 if @_
16 0 1828 if @_
36 45 8 unless $tf
43 7 2 if ($tf =~ /^\s*translate\s*\((.*?)\)(.*)/u) { }
2 0 elsif ($tf =~ /^\s*rotate\s*\((.*?)\)(.*)/u) { }
0 0 elsif ($tf =~ /^\s*scale\s*\((.*?)\)(.*)/u) { }
0 0 elsif ($tf =~ /^\s*matrix\s*\((.*?)\)(.*)/u) { }
0 0 elsif ($tf =~ /^\s*skew([XY])\s*\((.*?)\)(.*)/iu) { }
47 0 0 if ($nooptimize or $x or $y)
55 2 0 if ($nooptimize or $r)
56 0 2 if ($x or $y)
62 0 2 if ($x or $y)
72 0 0 if ($nooptimize or $x != 1 and $y != 1)
93 0 0 if ($1 eq "X")
101 0 0 if $self->root->verbose
118 0 0 unless @$m2 == 6
122 0 0 unless @$m1 == 6
137 46 70 if (defined(my $lw = $style->{'stroke-width'}))
142 0 46 if ($lw =~ /e[mx]/u)
148 0 46 if ($lw =~ /\%/u)
157 8 108 if (defined(my $linecap = $style->{'stroke-linecap'}))
159 4 4 if ($linecap eq 'round') { }
0 4 elsif ($linecap eq 'r') { }
2 2 elsif ($linecap eq 'square') { }
0 2 elsif ($linecap eq 's') { }
168 3 113 if (defined(my $linejoin = $style->{'stroke-linejoin'}))
170 1 2 if ($linejoin eq 'round') { }
0 2 elsif ($linejoin eq 'r') { }
1 1 elsif ($linejoin eq 'bevel') { }
0 1 elsif ($linejoin eq 'b') { }
181 0 116 if (lc $stroke eq "currentcolor")
186 65 51 if ($stroke ne 'none') { }
196 44 72 if (lc $fill eq "currentcolor")
201 63 53 if (lc $fill ne 'none' and $fill ne 'transparent') { }
210 2 114 if (my $sda = $style->{'stroke-dasharray'})
212 2 0 if ($sda and $sda ne "none")
226 65 17 if ($style->{'stroke'} && $style->{'stroke'} ne 'none' && $style->{'stroke'} ne 'transparent' && $style->{'stroke-width'} // !0) { }
17 0 elsif ($style->{'fill'} and $style->{'fill'} ne 'none' and $style->{'fill'} ne 'transparent') { }
233 12 53 if ($style->{'fill'} and $style->{'fill'} ne 'none' and $style->{'fill'} ne 'transparent') { }
271 0 5 unless $warned->{$name}++ or not $self->root->verbose
282 246 357 if ($e->{'type'} eq 'e') { }
357 0 elsif ($e->{'type'} eq 't') { }
284 10 236 unless $pkg->can("process")
307 193 146 if ref $c eq "SVGPDF::TextElement"
315 0 703 unless defined $a
320 0 703 unless $a =~ /^([-+]?[\d.]+)(.*)$/u
321 0 703 if $2 eq "pt"
324 695 8 if $2 eq "" or $2 eq "px"
327 8 0 if $2 eq "cm"
328 0 0 if $2 eq "mm"
329 0 0 if $2 eq "in"
331 0 0 if ($2 eq "%")
337 0 0 if ($2 eq "em")
343 0 0 if ($2 eq "ex")
354 0 20 unless defined $a
362 149 0 if ref $desc[0] eq "HASH"
367 13 136 if exists $atts{'xlink:href'}
381 585 1 if $param =~ /^(.*):(.*)$/u
399 236 350 unless (defined $p)
400 145 91 if ($flags =~ /s/u) { }
91 0 elsif ($flags =~ /[0HUV]/u) { }
403 0 0 if $flags =~ /\!/u
412 314 272 if ($flags =~ /([huv])/u)
414 2 312 if ($p =~ /^([\d.]+)\%$/u) { }
416 1 1 if ($flags eq 'w' or $param =~ /^(?:w(?:idth)|x)?$/iu) { }
1 0 elsif ($flag eq 'h' or $param =~ /^(?:h(?:eight)?|y)$/iu) { }
444 0 0 if ref $_ eq "SVGPDF::TextElement"
452 1 0 unless not $self->root->verbose or $aw->{$tag}++
462 0 33 if ($msg and $self->root->verbose)
490 0 8 unless ($src =~ m[ ^ data: (? [^/]+ ) / (? [^;]+ ) ; (? [^,]+ ) , (? . + ) $ ]sux)
499 8 0 if ($+{'encoding'} eq 'base64') { }
517 0 35 if @_