This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Allow diag.t to pass tests for multi-line warnings.
authorCraig A. Berry <craigberry@mac.com>
Thu, 29 Dec 2011 22:57:24 +0000 (16:57 -0600)
committerCraig A. Berry <craigberry@mac.com>
Thu, 29 Dec 2011 22:57:24 +0000 (16:57 -0600)
It's been sending the full warning text to t/test.pl's pass()
function.  If there are newlines in the the warning, t/TEST (though
not t/harness) will spew "Unexpected output at ..." messages and
fail the test.  In this context, the warning is just a message
printed by the test infrastructure, so we might as well use the
version of the warning that's already had newlines replaced with
spaces.

t/porting/diag.t

index ff0e3b2..58bed95 100644 (file)
@@ -324,7 +324,7 @@ sub check_message {
         }
       } else {
         # We found an actual valid entry in perldiag.pod for this error.
-        pass($name);
+        pass($key);
       }
       # Later, should start checking that the severity is correct, too.
     } elsif ($partial) {