Branch Coverage

lib/ControlFreak/Command.pm
Criterion Covered Total %
branch 39 100 39.0


line true false branch
61 36 4 if ($cmd)
68 7 33 unless ($cmd)
69 1 6 if ($param{'ignore_void'}) { }
79 0 33 unless $kw
83 1 32 unless $h
97 2 26 unless $param{'has_priv'}
100 3 23 unless $cmd
103 17 6 if ($cmd =~ /^([\w-]+)\s+([\w-]+)\s*=(.*)$/) { }
112 0 17 unless my $svc = $ctrl->find_or_create_svc($svcname)
117 17 0 if (defined $value)
121 2 15 if ($value =~ /^"(.*)"/ or $value =~ /^'(.*)'/)
126 5 12 if (defined $value and not length $value)
131 14 3 if ($attr eq 'cmd')
133 11 3 $succ ? :
139 3 0 unless $h
143 0 0 if (defined $value) { }
144 0 0 if $attr =~ / ^ ignore_std(out|err) | no_new_session | respawn_on_(fail|stop) $/x
153 0 0 $success ? :
165 0 1 unless $cmd
169 0 1 unless $command or @args
174 0 1 unless $h
189 0 0 unless $param{'has_priv'}
192 0 0 unless $cmd
195 0 0 if ($cmd =~ /^([\w-]+)\s+([\w-]+)\s*=(.*)$/) { }
204 0 0 unless my $sock = $ctrl->find_or_create_sock($sockname)
209 0 0 if (defined $value)
212 0 0 if $attr eq 'nonblocking'
215 0 0 if ($value =~ /^"(.*)"/ or $value =~ /^'(.*)'/)
220 0 0 if (defined $value and not length $value)
227 0 0 unless $h
231 0 0 if (defined $value) { }
238 0 0 $success ? :
250 1 4 unless $param{'has_priv'}
253 0 4 unless $cmd
256 2 2 if ($cmd =~ /^([\w-]+)\s+([\w-]+)\s+(.+)$/) { }
0 2 elsif ($cmd =~ /^([\w-]+)\s+([\w-]+)\s*=(.*)$/) { }
270 0 2 unless my $proxy = $ctrl->find_or_create_proxy($proxyname)
273 2 0 if ($subcmd and $subcmd eq 'service')
282 1 1 unless $svc
288 0 0 if ($attr eq 'cmd')
290 0 0 $succ ? :
295 0 0 if (defined $value)
297 0 0 if $attr =~ / ^noauto /x
300 0 0 if ($value =~ /^"(.*)"/ or $value =~ /^'(.*)'/)
305 0 0 if (defined $value and not length $value)
312 0 0 unless $h
316 0 0 if (defined $value) { }
323 0 0 $success ? :
328 0 0 if $value =~ /^1| true| on| enabled|yes/xi
329 0 0 if $value =~ /^0|false|off|disabled| no/xi