Branch Coverage

blib/lib/Test2/Mock.pm
Criterion Covered Total %
branch 83 92 90.2


line true false branch
21 1 85 if &blessed($class)
33 86 78 if ($class->can(uc $arg))
42 1 84 unless $self->{'class'}
48 1 77 unless $self->can($meth)
51 22 55 if (not $type) { }
1 54 elsif ($type eq 'HASH') { }
53 1 elsif ($type eq 'ARRAY') { }
69 340 1 unless $_[0]{'child'}
75 9 3 if @_
97 1 8 if $INC{$file}
160 2 11 if $stash->{'AUTOLOAD'} and *{$stash->{'AUTOLOAD'};}{"CODE"}
162 0 11 if $stash->{'can'} and *{$stash->{'can'};}{"CODE"}
239 1 2 if ($want) { }
1 1 elsif (defined $want) { }
251 1 2 if $want
252 1 1 if defined $want
294 13 4 unless $sym =~ /^[&\$\%\@]/
296 2 15 unless my $syms = $self->{'_symbols'}
301 2 13 unless $ref and @$ref
312 2 0 if @_
322 1 1 unless (@_)
338 15 132 if ($param =~ /^-(.*)$/)
345 115 17 if ref $arg and &reftype($arg) eq "CODE"
350 6 11 if (defined $arg and not ref $arg and $arg =~ /^(rw|ro|wo)$/) { }
5 6 elsif (not ref $arg) { }
6 0 elsif (&reftype($arg) eq 'HASH') { }
364 0 6 if $val and $is
366 4 0 $val ? :
368 0 6 if keys %$arg
376 4 13 if ($is eq 'rw') { }
2 11 elsif ($is eq 'ro') { }
2 9 elsif ($is eq 'wo') { }
409 3 1 unless $orig or $add or $set or $sig eq "&" and $class->can($sym)
413 2 0 if $add and $orig and &reftype($orig) ne 'SCALAR' || defined $$orig
420 3 139 if ($self->{'_track'} and $sig eq "&")
446 81 48 unless $set
460 4 0 unless $sym =~ /^[&\$\%\@]/
462 1 3 unless my $syms = $self->{'_symbols'}
467 1 2 unless $ref and @$ref
471 0 2 unless @$ref
481 4 125 unless $sym =~ /^[&\$\%\@]/
483 1 128 unless my $syms = $self->{'_symbols'}
488 1 127 unless $ref and @$ref
517 55 25 if $self->{'_symbols'}
519 8 72 if $self->{'_blocked_load'}
521 7 73 if $self->{'_purge_on_destroy'}