The file containing a single test for a warning in doop.c was added by
commit
0453d815b8a74697 in June 1999. However, as the file does not contain
an __END__ marker, the parser skips the entire contents of the file looking
for the __END__, and then assumes that the file contains no tests. This has
been true since the parser code was first implemented (in t/pragma/warning.t)
in commit
8ebc5c0145d2e355 in Jan 1997.
The simplest fix is to add an __END__ to the start of t/lib/warnings/doop
Also add some sanity checking to ensure that this doesn't happen again.
open my $fh, '<', $file or die "Cannot open $file: $!\n" ;
my $line = 0;
+ my $found;
while (<$fh>) {
$line++;
- last if /^__END__/ ;
+ if (/^__END__/) {
+ ++$found;
+ last;
+ }
}
+ # This is an internal error, and should never happen. All bar one of the
+ # files had an __END__ marker to signal the end of their preamble, although
+ # for some it wasn't technically necessary as they have no tests.
+ # It might be possible to process files without an __END__ by seeking back
+ # to the start and treating the whole file as tests, but it's simpler and
+ # more reliable just to make the rule that all files must have __END__ in.
+ # This should never fail - a file without an __END__ should not have been
+ # checked in, because the regression tests would not have passed.
+ die "Could not find '__END__' in $file"
+ unless $found;
{
local $/ = undef;
+__END__
# doop.c
use utf8 ;
$_ = "\x80 \xff" ;