Branch Coverage

blib/lib/Test/MockCommand.pm
Criterion Covered Total %
branch 75 100 75.0


line true false branch
37 3 15 if (@_ >= 3 and $_[1] eq 'record') { }
1 28 elsif (@_ >= 3 and $_[1] eq 'playback') { }
50 4 15 if defined $RECORDING_TO
74 0 68 unless @_ > 0
76 58 10 if (@_ < 3) { }
79 0 58 if $file =~ /^\s*\|(.+)\|\s*$/
80 0 58 if $file =~ /^\s*\|\s*(.+?)\s*$/
82 29 29 if $file =~ /^\s*(.+?)\s*\|\s*$/
87 0 10 if $_[1] =~ /^\s*-\|/
90 0 10 if $_[1] =~ /^\s*\|-/
113 52 30 if ($RECORDING) { }
117 52 1 if defined $result
120 52 0 if ($result)
130 29 1 if (@possible)
137 1 81 unless (defined $result)
139 0 1 if $func eq 'open'
140 0 1 if $func eq 'readpipe'
141 1 0 if $func eq 'system'
142 0 0 if $func eq 'exec'
146 1 80 if ($func eq 'exec')
149 1 0 WIFEXITED($code) ? :
154 27 53 if $func eq 'readpipe' and wantarray
171 13 15 defined $args->[0] ? :
176 0 28 if @{$args;} == 1
177 21 7 if @{$args;} == 2
188 1 5 unless defined $file
197 1 9 unless defined $file
198 2 7 if -d $file
203 2 5 unless open my $fh, '<', $file
206 0 5 if $@
207 0 5 unless defined $VAR1
221 0 7 unless defined $file
222 0 7 unless defined $file
224 0 7 unless open FH, ">$file"
225 0 7 unless print FH Dumper(\%COMMANDS)
226 0 7 unless close FH
232 0 2 unless UNIVERSAL::can($recorder, 'handle')
249 0 68 if @_ % 2
253 54 14 if (exists $args{'command'}) { }
254 11 43 if (ref $args{'command'} eq 'Regexp') { }
256 7 4 exists $args{'function'} ? :
258 18 15 if $_ =~ /$re/
264 39 4 exists $args{'function'} ? :
269 4 10 if exists $args{'function'}
288 25 5 if (@_ >= 1)
289 0 25 unless defined $_[0]
297 9 6 if @_ >= 1
303 0 22 unless @_ == 1
304 3 19 if (defined $_[0]) { }
305 0 3 unless ref $_[0] eq 'CODE'