From: Rafael Garcia-Suarez Date: Tue, 20 May 2008 10:14:28 +0000 (+0200) Subject: Re: [PATCH: TODO Tests] Re: [perl #53806] No complain about bareword X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ace56ae50476eeb045e2f78e4b9550922f258fde;p=p5sagit%2Fp5-mst-13.2.git Re: [PATCH: TODO Tests] Re: [perl #53806] No complain about bareword From: "Rafael Garcia-Suarez" Message-ID: p4raw-id: //depot/perl@33876 --- diff --git a/lib/strict.t b/lib/strict.t index b5911b3..16dcbec 100644 --- a/lib/strict.t +++ b/lib/strict.t @@ -84,17 +84,20 @@ for (@prgs){ $expected =~ s|(\./)?abc\.pm|:abc.pm|g if $^O eq 'MacOS'; $expected =~ s|./abc|:abc|g if $^O eq 'MacOS'; my $prefix = ($results =~ s/^PREFIX\n//) ; + my $TODO = $prog =~ m/^#\s*TODO:/; if ( $results =~ s/^SKIPPED\n//) { print "$results\n" ; } elsif (($prefix and $results !~ /^\Q$expected/) or (!$prefix and $results ne $expected)){ - print STDERR "PROG: $switch\n$prog\n"; - print STDERR "EXPECTED:\n$expected\n"; - print STDERR "GOT:\n$results\n"; + if (! $TODO) { + 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"; + print "ok " . ++$i . ($TODO ? " # TODO" : "") . "\n"; foreach (@temps) { unlink $_ if $_ } } diff --git a/t/lib/strict/subs b/t/lib/strict/subs index 20a8afa..2c9aa87 100644 --- a/t/lib/strict/subs +++ b/t/lib/strict/subs @@ -393,3 +393,18 @@ my @a;my $x=$a[FOO]; EXPECT Bareword "FOO" not allowed while "strict subs" in use at - line 2. Execution of - aborted due to compilation errors. +######## +# TODO: [perl #53806] No complain about bareword +use strict 'subs'; +print FOO . "\n"; +EXPECT +Bareword "FOO" not allowed while "strict subs" in use at - line 3. +Execution of - aborted due to compilation errors. +######## +# TODO: [perl #53806] No complain about bareword +use strict 'subs'; +$ENV{PATH} = ""; +system(FOO . "\n"); +EXPECT +Bareword "FOO" not allowed while "strict subs" in use at - line 4. +Execution of - aborted due to compilation errors.