summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2012-03-07 07:12:00 -0600
committerCraig A. Berry <craigberry@mac.com>2012-03-07 07:13:05 -0600
commitffb73d652a484e55333d3bfab58687234ac784fb (patch)
treea4e41ff146f407d11a8d7040fe447ccd0a8691a5
parent12a680b783014913cce47bdc06914d345a95240a (diff)
downloadperl-ffb73d652a484e55333d3bfab58687234ac784fb.tar.gz
fix warning in test.pl diagnostics output.
2f137bbd018b assumed that $name is always defined, but it isn't always, and when it's not the resulting undefined value warning could corrupt test output and even make TODO tests trigger failure with "unexpected output at test 0."
-rw-r--r--t/test.pl5
1 files changed, 4 insertions, 1 deletions
diff --git a/t/test.pl b/t/test.pl
index 604cdda80f..b33c634fef 100644
--- a/t/test.pl
+++ b/t/test.pl
@@ -210,7 +210,10 @@ sub _ok {
note @mess; # Ensure that the message is properly escaped.
}
else {
- _diag "# Failed test $test - $name $where\n";
+ my $msg = "# Failed test $test - ";
+ $msg.= "$name " if $name;
+ $msg .= "$where\n";
+ _diag $msg;
_diag @mess;
}