Skip to content

Commit

Permalink
Avoid warnings about uninitialized values (RT #124445)
Browse files Browse the repository at this point in the history
There were 5 such warnings when running 'perl6 --doc lib/Test.pm'
  • Loading branch information
usev6 committed Oct 24, 2015
1 parent 2f4bfd8 commit 3c00699
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Test.pm
Expand Up @@ -541,7 +541,7 @@ sub done-testing() is export {
$output.say: $indents ~ "1..$num_of_tests_planned";
}

if ($num_of_tests_planned != $num_of_tests_run) { ##Wrong quantity of tests
if ($num_of_tests_planned or $num_of_tests_run) && ($num_of_tests_planned != $num_of_tests_run) { ##Wrong quantity of tests
diag("Looks like you planned $num_of_tests_planned test{ $num_of_tests_planned == 1 ?? '' !! 's'}, but ran $num_of_tests_run");
}
if ($num_of_tests_failed) {
Expand Down Expand Up @@ -605,10 +605,10 @@ END {
$handle.?close;
}

if $num_of_tests_failed > 0 {
if $num_of_tests_failed and $num_of_tests_failed > 0 {
exit($num_of_tests_failed min 254);
}
elsif !$no_plan && $num_of_tests_planned != $num_of_tests_run {
elsif !$no_plan && ($num_of_tests_planned or $num_of_tests_run) && $num_of_tests_planned != $num_of_tests_run {
exit(255);
}
else {
Expand Down

0 comments on commit 3c00699

Please sign in to comment.