Branch Coverage

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


line true false branch
127 3 0 unless @where
135 12 3 unless / [.] pm \z /msx
140 3 0 unless $dir[-1]
143 2 1 unless exists $module_tried{$module}
148 2 1 if (@not_tried)
173 17 4 unless defined $name
178 11 10 if _eval_in_pkg($eval, $ctx->trace->call)
184 8 2 if $opt->{'load_error'}
192 2 4 if _load_module($opt, $module, $version, $import)
195 4 0 unless defined $name
198 1 3 if defined $num and $num =~ / [^0-9] /msx
214 2 3 if _load_module($opt, $module, $version, $import)
217 3 0 unless defined $name
251 9 41 unless ($psr)
264 3 47 unless ($psr->getoptions($opt, ("load_error=s", "require|req!")))
265 3 0 if (defined $opt_err) { }
273 34 13 if ($opt->{'load_error'})
276 1 33 unless $opt->{'load_error'} =~ / ( %+ ) [ #0+-]* [0-9]* s /msx and length($1) % 2
284 13 5 if (@ARGV)
294 4 9 unless @ARGV
301 1 3 unless defined $module
314 1 6 unless defined $module
316 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]+)? ) )/ ? :
334 3 1 unless my $code = $pkg->can("CLASS")
354 4 0 if "Test2::Tools::LoadModule" eq $hint_pkg
363 29 44 unless "HASH" eq ref $arg[0]
368 16 57 if defined $version
371 19 54 if ($import and @{$import;}) { }
42 12 elsif (defined $import xor not $opt->{'require'}) { }
386 2 32 if ($max_arg and @ARGV > $max_arg)
393 4 28 unless defined $module
396 7 22 if (defined $version)
397 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]+)? ) )/
401 3 23 unless not defined $import or "ARRAY" eq ref $import
430 22 11 if "Test2::Tools::LoadModule" eq $info[0]
432 11 0 unless $info[1] =~ / \A [(] eval \b /msx