lib/File/Find/t/taint.t See if File::Find works with taint
lib/FileHandle.pm Backward-compatible front end to IO extension
lib/FileHandle.t See if FileHandle works
+lib/File/stat-7896.t A test for ID 20011110.104
lib/File/stat.pm By-name interface to Perl's builtin stat
lib/File/stat.t See if File::stat works
lib/filetest.pm For "use filetest"
--- /dev/null
+#!./perl -w
+use strict;
+
+use Test::More;
+use File::stat;
+
+# This is possibly a bit black-box, but for now it works.
+# If (either) File::stat stops lazy loading Symbol, or Test::More starts, it
+# should be revisited
+is($INC{'Symbol.pm'}, undef, "Symbol isn't loaded yet");
+
+# ID 20011110.104 (RT #7896)
+$! = 0;
+is($!, '', '$! is empty');
+is(File::stat::stat('/notafile'), undef, 'invalid file should fail');
+isnt($!, '', 'should populate $!, given invalid file');
+my $e = $!;
+
+isnt($INC{'Symbol.pm'}, undef, "Symbol has been loaded");
+
+# Repeat twice
+is(File::stat::stat('/notafile'), undef, 'invalid file should fail again');
+is($!, $e, '$! should be consistent for an invalid file');
+$e = $!;
+is(File::stat::stat('/notafile'), undef, 'invalid file should fail again');
+is($!, $e, '$! should be consistent for an invalid file');
+
+done_testing();
ok(-p($pstat), "check -p detects a pipe");
}
-local $!;
-$stat = stat '/notafile';
-isnt( $!, '', 'should populate $!, given invalid file' );
-
# Testing pretty much anything else is unportable.
done_testing;