Branch Coverage

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


line true false branch
21 1 77 if &blessed($class)
33 78 70 if ($class->can(uc $arg))
42 1 76 unless $self->{'class'}
48 1 69 unless $self->can($meth)
51 22 47 if (not $type) { }
1 46 elsif ($type eq 'HASH') { }
45 1 elsif ($type eq 'ARRAY') { }
69 316 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 124 if ($param =~ /^-(.*)$/)
345 107 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 131 if ($self->{'_track'} and $sig eq "&")
446 81 40 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 117 unless $sym =~ /^[&\$\%\@]/
483 1 120 unless my $syms = $self->{'_symbols'}
488 1 119 unless $ref and @$ref
517 47 25 if $self->{'_symbols'}
519 8 64 if $self->{'_blocked_load'}
521 7 65 if $self->{'_purge_on_destroy'}