Branch Coverage

blib/lib/Test/Spec/Mocks.pm
Criterion Covered Total %
branch 107 134 79.8


line true false branch
25 2 17 @_ ? :
30 0 71 unless (grep {$_ eq $sym;} @EXPORT_OK)
33 36 35 $To_Universal{$sym} ? :
36 0 71 if (defined &$dest)
37 0 0 if (*{$dest;}{'CODE'} == *{$src;}{'CODE'}) { }
59 0 60 if (@_ != 2 or ref $_[1])
73 7 64 if (@_ > 0 and @_ % 2 == 0) { }
1 63 elsif (@_ == 1 and ref $_[0] eq 'HASH') { }
63 0 elsif (@_ == 1 and not ref $_[0]) { }
100 8 63 if exists $method->{'value'}
114 29 0 if (@_ % 2 == 0) { }
0 0 elsif (@_ == 1 and ref $_[0] eq 'HASH') { }
124 1 28 if @_
130 0 1 if @_
154 71 0 if (@_)
156 0 71 if (@_ or ref $args ne 'HASH')
160 71 71 if ($name eq 'target') { }
71 0 elsif ($name eq 'method') { }
175 71 1557 if @_
181 764 847 if @_
187 764 2890 if @_
193 71 2358 if @_
199 44 154 if @_
205 56 764 if @_
206 15 805 unless (exists $self->{'__canceled'})
220 69 215 unless (defined $self->{'__call_count'})
235 113 86 if @_
244 7 37 if (@_ == 1 and ref $_[0] eq 'CODE') { }
37 0 elsif (@_ == 1) { }
286 12 111 if @_
292 14 98 if @_
298 155 40 if @_
304 74 12 unless defined $self->_eq_args
305 2 10 unless $self->_call_count
307 3 7 if (not defined $self->_given_args or scalar @{$self->_eq_args;} != scalar @{$self->_given_args;})
314 3 5 unless ($self->_match_arguments($a, $b))
315 0 3 unless defined $a
316 0 3 unless defined $b
326 0 0 unless defined $a or defined $b
327 0 8 unless defined $a and defined $b
333 72 14 unless defined $self->_deep_args
334 2 12 unless $self->_call_count
339 5 7 unless ($same)
358 1 156 if @_
370 6 14 $n == 1 ? :
372 12 8 @params ? :
379 0 5 unless (defined $n_times and $n_times =~ /^\A\d+\z/)
383 3 2 if ($self->_call_count != $n_times)
400 4 26 if ($self->_call_count != 1)
411 0 17 unless (defined $n_times and $n_times =~ /^\A\d+\z/)
415 2 32 if ($self->_call_count < $n_times)
431 0 10 unless (defined $n_times and $n_times =~ /^\A\d+\z/)
435 3 7 if ($self->_call_count > $n_times)
467 1 31 if @msgs
474 12 74 if (my $message = $self->_check_call_count->())
492 0 764 if ($Test::Spec::Mocks::Debug)
498 735 29 if (ref $self->_target) { }
509 0 764 if ($Test::Spec::Mocks::Debug)
516 681 83 if ($self->_original_code) { }
535 32 732 unless $self->_canceled
560 144 2 if (&Scalar::Util::refaddr($_[0]) == &Scalar::Util::refaddr($target)) { }
0 2 elsif (not $original_method) { }
566 1 143 if $self->_exception
589 3 26 defined &$dest ? :
597 0 11 if $self->_exception
604 681 83 if ($self->_original_code)
607 0 681 if (defined(my $proto = prototype $self->_original_code))