diff options
author | Craig A. Berry <craigberry@mac.com> | 2012-03-07 07:12:00 -0600 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2012-03-07 07:13:05 -0600 |
commit | ffb73d652a484e55333d3bfab58687234ac784fb (patch) | |
tree | a4e41ff146f407d11a8d7040fe447ccd0a8691a5 | |
parent | 12a680b783014913cce47bdc06914d345a95240a (diff) | |
download | perl-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.pl | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; } |