diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-06-24 00:10:55 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-06-24 00:11:42 -0700 |
commit | c6cec3077440d7e149a8013d9939e2f5626ce21a (patch) | |
tree | e73ccea695e921fa3602a563e98ec0d5c94cae54 /lib/File | |
parent | 1adb05cd11a15cd5a64c8642648d985290404adc (diff) | |
download | perl-c6cec3077440d7e149a8013d9939e2f5626ce21a.tar.gz |
[perl #113796] lib/File/stat.t failures when -l $^X
It seems that gcc produces this:
$ ./perl -Ilib -e 'warn $^X'
/Users/sprout/Perl/perl.git/perl at -e line 1.
while g++ produces this:
$ ./perl -Ilib -e 'warn $^X'
./perl at -e line 1.
(I may be misdiagnosing this, but I have two blead builds that give
different values for $^X.)
The script is using $^X for testing, which is why it could produce
different results.
In any case, this produces the same output for both compilers:
use File::stat;
my $stat = File::stat::stat('./perl');
warn eval '-l $stat';
warn eval '-l "./perl"';
__END__
Warning: something's wrong at - line 3.
1 at - line 4.
The test is wrong, as -l _ will fail after a stat. You have to do
lstat for -l _ to work. Similarly, -l $stat_obj should only return
true if the $stat_obj was returned by File::stat::lstat.
This commit adjusts the test accordingly.
Diffstat (limited to 'lib/File')
-rw-r--r-- | lib/File/stat.t | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/File/stat.t b/lib/File/stat.t index 51002716a3..b85ff95462 100644 --- a/lib/File/stat.t +++ b/lib/File/stat.t @@ -55,6 +55,7 @@ sub test_X_ops { my ($file, $desc_tail, $skip) = @_; my @stat = CORE::stat $file; my $stat = File::stat::stat($file); + my $lstat = File::stat::lstat($file); isa_ok($stat, 'File::stat', 'should build a stat object'); for my $op (split //, "rwxoRWXOezsfdlpSbcugkMCA") { @@ -62,6 +63,7 @@ sub test_X_ops { note("Not testing -A $desc_tail"); next; } + my $stat = $op eq 'l' ? $lstat : $stat; for my $access ('', 'use filetest "access";') { my ($warnings, $awarn, $vwarn, $rv); my $desc = $access |