How about: + my $todo_reason; + $todo_reason = $1 if $prog =~ s/^#\s*TODO(.*)\n//m; ! print " # TODO$todo_reason" if defined $todo_reason; -----Original Message----- From: Abigail [mailto:abigail@abigail.nl] Sent: 01 October 2003 13:20 To: schwern@pobox.com Cc: Perl5 Porters Subject: Re: [PATCH lib/warnings.t] Adding TODO functionality to lib/warnings. On Tue, Sep 30, 2003 at 05:51:30PM -0700, schwern@pobox.com wrote: > On Wed, Oct 01, 2003 at 12:07:26AM +0200, Abigail wrote: > > The following patch allows one to add 'TODO' tests to lib/warning > > tests. > > My development environment is a little screwy at the moment, so I can't > submit a proper patch, but... [ Snip ] Good idea. Here's a redone patch: *** lib/warnings.t.orig Wed Oct 1 12:46:20 2003 --- lib/warnings.t Wed Oct 1 13:51:01 2003 *************** *** 76,81 **** --- 76,83 ---- $switch =~ s/(-\S*[A-Z]\S*)/"$1"/ if $Is_VMS; # protect uc switches } my($prog,$expected) = split(/\nEXPECT\n/, $_); + my ($todo, $todo_reason); + $todo = $prog =~ s/^#\s*TODO(.*)\n//m and $todo_reason = $1; if ( $prog =~ /--FILE--/) { my(@files) = split(/\n--FILE--\s*([^\s\n]*)\s*\n/, $prog) ; shift @files ; *************** *** 177,188 **** (!$option_regex && $results !~ /^\Q$expected/))) or (!$prefix && (( $option_regex && $results !~ /^$expected/) || (!$option_regex && $results ne $expected)))) { ! print STDERR "PROG: $switch\n$prog\n"; ! print STDERR "EXPECTED:\n$expected\n"; ! print STDERR "GOT:\n$results\n"; print "not "; } ! print "ok " . ++$i . "\n"; foreach (@temps) { unlink $_ if $_ } foreach (@temp_path) --- 179,199 ---- (!$option_regex && $results !~ /^\Q$expected/))) or (!$prefix && (( $option_regex && $results !~ /^$expected/) || (!$option_regex && $results ne $expected)))) { ! 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; ! } print "not "; } ! print "ok " . ++$i; ! print " # TODO$todo_reason" if $todo; ! print "\n"; foreach (@temps) { unlink $_ if $_ } foreach (@temp_path) ------------------------------------------------------------------- This e-mail and any attachments may contain confidential and/or privileged material; it is for the intended addressee(s) only. If you are not a named addressee, you must not use, retain or disclose such information. NPL Management Ltd cannot guarantee that the e-mail or any attachments are free from viruses. NPL Management Ltd. Registered in England and Wales. No: 2937881 Registered Office: Teddington, Middlesex, United Kingdom TW11 0LW. -------------------------------------------------------------------