> [EMAIL PROTECTED] - Thu Jan 08 05:18:53 2004]: 
>  
>    $Test->diag(1,2,3,4); 
>  
> yields "# 1# 2# 3# 4" which is not right. 
> It seems like the intent was for each argument to be a line, 
> so it should yield something like: 
>  
>     # 1 
>     # 2 
>     # 3 
>     # 4 
>  
> The fix is to modify the foreach loop in sub diag like so: 
>  
>     # Escape each line with a #. 
>     foreach (@msgs) { 
>         $_ = 'undef' unless defined; 
>         s/^/# /gms; 
>         $_.="\n" unless /\n/; 
>     } 
>  
 
Attached is a patch implementing the above change against the current 
version of Test::Builder.   
--- /usr/lib/perl5/5.8.5/Test/Builder.pm	2004-10-14 22:07:33.000000000 -0500
+++ Builder.pm	2004-10-25 18:51:44.000000000 -0500
@@ -945,6 +945,7 @@
     foreach (@msgs) {
         $_ = 'undef' unless defined;
         s/^/# /gms;
+        $_ .= "\n" unless /\n/;
     }
 
     push @msgs, "\n" unless $msgs[-1] =~ /\n\Z/;

Reply via email to