Change 13093 by jhi@alpha on 2001/11/19 14:07:20

        Subject: [PATCH t/op/closure.t] A little extra debugging output
        From: Michael G Schwern <[EMAIL PROTECTED]> 
        Date: Mon, 19 Nov 2001 03:11:12 -0500                 
        Message-ID: <20011119031112.E786@blackrider>

Affected files ...

.... //depot/perl/t/op/closure.t#12 edit

Differences ...

==== //depot/perl/t/op/closure.t#12 (xtext) ====
Index: perl/t/op/closure.t
--- perl/t/op/closure.t.~1~     Mon Nov 19 07:15:05 2001
+++ perl/t/op/closure.t Mon Nov 19 07:15:05 2001
@@ -4,6 +4,7 @@
 #   Original written by Ulrich Pfeifer on 2 Jan 1997.
 #   Greatly extended by Tom Phoenix <[EMAIL PROTECTED]> on 28 Jan 1997.
 #
+#   Run with -debug for debugging output.
 
 BEGIN {
     chdir 't' if -d 't';
@@ -16,7 +17,9 @@
 
 my $test = 1;
 sub test (&) {
-  print ((&{$_[0]})?"ok $test\n":"not ok $test\n");
+  my $ok = &{$_[0]};
+  print $ok ? "ok $test\n" : "not ok $test\n";
+  printf "# Failed at line %d\n", (caller)[2] unless $ok;
   $test++;
 }
 
@@ -234,14 +237,14 @@
 
          $code = "# This is a test script built by t/op/closure.t\n\n";
 
-         $code .= <<"DEBUG_INFO" if $debugging;
-# inner_type: $inner_type 
+         print <<"DEBUG_INFO" if $debugging;
+# inner_type:     $inner_type 
 # where_declared: $where_declared 
-# within: $within
-# nc_attempt: $nc_attempt
-# call_inner: $call_inner
-# call_outer: $call_outer
-# undef_outer: $undef_outer
+# within:         $within
+# nc_attempt:     $nc_attempt
+# call_inner:     $call_inner
+# call_outer:     $call_outer
+# undef_outer:    $undef_outer
 DEBUG_INFO
 
          $code .= <<"END_MARK_ONE";
@@ -262,9 +265,9 @@
 {
     my \$test = $test;
     sub test (&) {
-      my \$result = &{\$_[0]};
-      print "not " unless \$result;
-      print "ok \$test\\n";
+      my \$ok = &{\$_[0]};
+      print \$ok ? "ok \$test\n" : "not ok \$test\n";
+      printf "# Failed at line %d\n", (caller)[2] unless \$ok;
       \$test++;
     }
 }
@@ -499,7 +502,7 @@
            }
          }
          printf "not ok: exited with error code %04X\n", $? if $?;
-         print "-" x 30, "\n" if $debugging;
+         print '#', "-" x 30, "\n" if $debugging;
 
        }       # End of foreach $within
       }        # End of foreach $where_declared
End of Patch.

Reply via email to