Branch Coverage

blib/lib/Text/Macro.pm
Criterion Covered Total %
branch 86 116 74.1


line true false branch
27 0 19 unless my $filename = $args{'file'}
29 19 0 if (exists $args{'path'})
31 0 19 if (!$path =~ m[/$])
36 3 16 if (exists $cache{$filename})
62 0 19 unless my $fh = 'IO::File'->new($file_name)
65 3 267 /^\s*\#include\s+(.*)\n$/ ? :
90 80 84 if (ref $_ ne 'ARRAY') { }
109 82 112 if (defined $str and substr($str, -1, 1) eq q[']) { }
134 104 161 if (my($cmd, $cond) = $line =~ / ^ \s*\#( if | for | elsif | else | endif | endfor | comment | sub | callsub | pre | switch | case | endswitch | default | set )\b \s* (.*) \n $ /x) { }
138 15 89 if ($cmd eq 'if') { }
4 85 elsif ($cmd eq 'set') { }
5 80 elsif ($cmd eq 'switch') { }
5 75 elsif ($cmd eq 'endswitch') { }
6 69 elsif ($cmd eq 'case') { }
4 65 elsif ($cmd eq 'default') { }
0 65 elsif ($cmd eq 'pre') { }
10 55 elsif ($cmd eq 'sub') { }
14 41 elsif ($cmd eq 'callsub') { }
7 34 elsif ($cmd eq 'for') { }
8 26 elsif ($cmd eq 'else') { }
4 22 elsif ($cmd eq 'elsif') { }
15 7 elsif ($cmd eq 'endif') { }
7 0 elsif ($cmd eq 'endfor') { }
0 0 elsif ($cmd eq 'comment') { }
139 0 15 unless $cond
152 0 4 unless $cond
155 0 4 unless $var
161 2 6 if ($var_name) { }
162 1 1 unless defined $ref_data
171 0 5 unless $var
177 0 5 unless $$this{'stack'}[-1] eq 's' or $$this{'stack'}[-1] eq 'd'
180 3 2 unless $$this{'switch_stack'}[-1][1]
184 0 6 unless @syms
187 0 6 unless @{$$this{'switch_stack'};}
190 3 3 if ($$switch_item[1]) { }
198 0 4 unless @{$$this{'switch_stack'};}
200 1 3 if ($$switch_item[1]) { }
215 0 10 unless $sub_name
229 0 14 unless $sub_name
232 0 14 unless exists $$this{'subs'}{$sub_name}
235 7 7 if ($params)
244 7 7 if ($params)
248 0 7 unless my($var) = $cond =~ /\#\#(\w+)\#\#/
251 3 4 if ($cond =~ /; sep="(.*?)"/) { }
273 0 8 unless $$this{'stack'}[$#{$$this{'stack'};}] eq 'i'
278 0 4 unless $cond
281 0 4 unless $$this{'stack'}[$#{$$this{'stack'};}] eq 'i'
294 0 15 unless $_ eq 'i' or $_ eq 'e'
300 0 7 unless $$this{'stack'}[$#{$$this{'stack'};}] eq 'f'
302 3 4 if (length $$this{'for_sep'}[-1])
321 33 194 if ($var_name) { }
322 17 16 unless defined $ref_data
354 0 16 if @{$$this{'stack'};}
358 80 94 if (ref $block eq 'ARRAY')
385 0 1 unless $$this{'code'}
396 0 2 unless $$this{'code'}
407 0 1 unless my $fh = 'IO::File'->new(">$file_name")
418 0 16 unless $$this{'code'}