This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Fix the TODO handling in t/re/ReTest.pl's skip()
authorNicholas Clark <nick@ccl4.org>
Wed, 2 Mar 2011 13:46:10 +0000 (13:46 +0000)
committerNicholas Clark <nick@ccl4.org>
Wed, 2 Mar 2011 13:46:10 +0000 (13:46 +0000)
It now does TODO & SKIP. However, currently I believe that nothing that uses it
is calling skip() with a TODO test.

t/re/ReTest.pl

index 766065c..fc25087 100644 (file)
@@ -102,16 +102,20 @@ sub skip {
     safe_globals();
     $why =~ s/\n.*//s;
     $why .= "; Bug $BugId" if defined $BugId;
-    # seems like the new harness code doesn't like todo and skip to be mixed.
-    # which seems like a bug in the harness to me. -- dmq
-    #$why .= " # TODO $TODO" if defined $TODO;
-    
+    my $ok;
+    if (defined $TODO) {
+       $why = "TODO & SKIP $why $TODO";
+       $ok = "not ok";
+    } else {
+       $why = "SKIP $why";
+       $ok = "ok";
+    }
+
     my $n = shift // 1;
     my $line_nr = (caller(0)) [2];
     for (1 .. $n) {
         ++ $test;
-        #print "not " if defined $TODO;
-        print "ok $test # skip $why\tLine $line_nr\n";
+        print "$ok $test # $why\tLine $line_nr\n";
     }
     no warnings "exiting";
     last SKIP;