This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In t/lib/common.pl, inline print_err_line into its only caller.
authorNicholas Clark <nick@ccl4.org>
Thu, 24 Feb 2011 13:45:33 +0000 (13:45 +0000)
committerNicholas Clark <nick@ccl4.org>
Thu, 24 Feb 2011 13:45:33 +0000 (13:45 +0000)
t/lib/common.pl

index 4ed7143..8c81603 100644 (file)
@@ -198,7 +198,19 @@ for (@prgs){
     }
  
     local $::TODO = $reason{todo};
-    print_err_line( $switch, $prog, $expected, $results, $::TODO ) unless $ok;
+
+    unless ($ok) {
+       my $err_line = "PROG: $switch\n$prog\n" .
+                      "EXPECTED:\n$expected\n" .
+                      "GOT:\n$results\n";
+       if ($::TODO) {
+           $err_line =~ s/^/# /mg;
+           print $err_line;  # Harness can't filter it out from STDERR.
+       }
+       else {
+           print STDERR $err_line;
+       }
+    }
 
     ok($ok);
 
@@ -208,20 +220,4 @@ for (@prgs){
        { rmtree $_ if -d $_ }
 }
 
-sub print_err_line {
-    my($switch, $prog, $expected, $results, $todo) = @_;
-    my $err_line = "PROG: $switch\n$prog\n" .
-                  "EXPECTED:\n$expected\n" .
-                  "GOT:\n$results\n";
-    if ($todo) {
-       $err_line =~ s/^/# /mg;
-       print $err_line;  # Harness can't filter it out from STDERR.
-    }
-    else {
-       print STDERR $err_line;
-    }
-
-    return 1;
-}
-
 1;