diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-01-14 13:12:07 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-01-14 14:16:26 -0800 |
commit | 0d5064f119150c3a17481d5c2ece0ae5d24ae9d9 (patch) | |
tree | 557b2b75e824adce8815c2f64c838c6e7461980c /t | |
parent | ac737fdfcf5daa2a78d524ec276c62b4586f2e6d (diff) | |
download | perl-0d5064f119150c3a17481d5c2ece0ae5d24ae9d9.tar.gz |
Make lstat($ioref) and lstat($gv) consistent
As documented in perldiag, lstat($gv) warns and does an fstat.
lstat($ioref) wasn’t doing what was documented, but after warning
would do the same as stat(_).
Diffstat (limited to 't')
-rw-r--r-- | t/op/stat.t | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/t/op/stat.t b/t/op/stat.t index 3e998658bf..59c7398a83 100644 --- a/t/op/stat.t +++ b/t/op/stat.t @@ -20,7 +20,7 @@ if(eval {require File::Spec; 1}) { } -plan tests => 111; +plan tests => 112; my $Perl = which_perl(); @@ -465,6 +465,13 @@ lstat "test.pl"; } like $@, qr/^The stat preceding lstat\(\) wasn't an lstat at /, 'stat $ioref resets stat type'; + +{ + my @statbuf = stat STDOUT; + stat "test.pl"; + my @lstatbuf = lstat *STDOUT{IO}; + is "@lstatbuf", "@statbuf", 'lstat $ioref reverts to regular fstat'; +} SKIP: { skip "No lstat", 2 unless $Config{d_lstat}; |