Branch Coverage

blib/lib/Test2/Tools/LoadModule.pm
Criterion Covered Total %
branch 65 72 90.2


line true false branch
128 3 0 unless @where
136 12 3 unless / [.] pm \z /msx
141 3 0 unless $dir[-1]
144 2 1 unless exists $module_tried{$module}
149 2 1 if (@not_tried)
174 17 4 unless defined $name
179 11 10 if _eval_in_pkg($eval, $ctx->trace->call)
185 8 2 if $opt->{'load_error'}
193 2 4 if _load_module($opt, $module, $version, $import)
196 4 0 unless defined $name
199 1 3 if defined $num and $num =~ / [^0-9] /msx
215 2 3 if _load_module($opt, $module, $version, $import)
218 3 0 unless defined $name
252 9 41 unless ($psr)
265 3 47 unless ($psr->getoptions($opt, ("load_error=s", "require|req!")))
266 3 0 if (defined $opt_err) { }
274 34 13 if ($opt->{'load_error'})
277 1 33 unless $opt->{'load_error'} =~ / ( %+ ) [ #0+-]* [0-9]* s /msx and length($1) % 2
285 13 5 if (@ARGV)
295 4 9 unless @ARGV
302 1 3 unless defined $module
315 1 6 unless defined $module
317 1 5 defined $arg[0] && $arg[0] =~ /(?x: (?x: v (?-x:[0-9]+) (?-x: (?-x:\.[0-9]+)+ (?-x:_[0-9]+)? )? | (?-x:[0-9]+)? (?-x:\.[0-9]+){2,} (?-x:_[0-9]+)? ) | (?x: (?-x:[0-9]+) (?-x: (?-x:\.[0-9]+) | \. )? (?-x:_[0-9]+)? | (?-x:\.[0-9]+) (?-x:_[0-9]+)? ) )/ ? :
335 3 1 unless my $code = $pkg->can("CLASS")
355 4 0 if "Test2::Tools::LoadModule" eq $hint_pkg
364 29 44 unless "HASH" eq ref $arg[0]
369 16 57 if defined $version
372 19 54 if ($import and @{$import;}) { }
42 12 elsif (defined $import xor not $opt->{'require'}) { }
387 2 32 if ($max_arg and @ARGV > $max_arg)
394 4 28 unless defined $module
397 7 22 if (defined $version)
398 3 4 unless $version =~ /(?x: (?x: v (?-x:[0-9]+) (?-x: (?-x:\.[0-9]+)+ (?-x:_[0-9]+)? )? | (?-x:[0-9]+)? (?-x:\.[0-9]+){2,} (?-x:_[0-9]+)? ) | (?x: (?-x:[0-9]+) (?-x: (?-x:\.[0-9]+) | \. )? (?-x:_[0-9]+)? | (?-x:\.[0-9]+) (?-x:_[0-9]+)? ) )/
402 3 23 unless not defined $import or "ARRAY" eq ref $import
431 22 11 if "Test2::Tools::LoadModule" eq $info[0]
433 11 0 unless $info[1] =~ / \A [(] eval \b /msx