From: Andreas König Date: Fri, 15 Aug 2003 11:37:29 +0000 (+0200) Subject: TEST script (Was: Not ok 20712ff) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=21c74f43bb8a4eac1af459c973ca694bf54dde7b;p=p5sagit%2Fp5-mst-13.2.git TEST script (Was: Not ok 20712ff) Message-ID: <87wudf9s86.fsf_-_@franz.ak.mind.de> p4raw-id: //depot/perl@20721 --- diff --git a/t/TEST b/t/TEST index c42d10a..ecd5122 100755 --- a/t/TEST +++ b/t/TEST @@ -300,35 +300,47 @@ EOT $ok = 0; $next = 0; + my $seen_leader = 0; + my $seen_ok = 0; while () { next if /^\s*$/; # skip blank lines if ($verbose) { print $_; } - unless (/^#/) { + unless (/^\#/) { if (/^1\.\.([0-9]+)( todo ([\d ]+))?/) { $max = $1; %todo = map { $_ => 1 } split / /, $3 if $3; $totmax += $max; $files += 1; - $next = 1; - $ok = 1; + unless ($seen_ok) { + $next = 1; + $ok = 1; + } + $seen_leader = 1; } else { - if (/^(not )?ok (\d+)[^#]*(\s*#.*)?/ && - $2 == $next) - { - my($not, $num, $extra) = ($1, $2, $3); - my($istodo) = $extra =~ /^\s*#\s*TODO/ if $extra; - $istodo = 1 if $todo{$num}; - - if( $not && !$istodo ) { - $ok = 0; - $next = $num; - last; + if (/^(not )?ok (\d+)[^\#]*(\s*\#.*)?/) { + unless ($seen_leader) { + unless ($seen_ok) { + $next = 1; + $ok = 1; + } } - else { - $next = $next + 1; + $seen_ok = 1; + if ($2 == $next) { + my($not, $num, $extra) = ($1, $2, $3); + my($istodo) = $extra =~ /^\s*#\s*TODO/ if $extra; + $istodo = 1 if $todo{$num}; + + if( $not && !$istodo ) { + $ok = 0; + $next = $num; + last; + } + else { + $next = $next + 1; + } } } elsif (/^Bail out!\s*(.*)/i) { # magic words