diff options
author | Father Chrysostomos <sprout@cpan.org> | 2012-01-12 14:32:30 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-01-12 14:32:30 -0800 |
commit | 5731662b7617da2ff1626044f081de38b50a0ddc (patch) | |
tree | dd7711f6bffe713e26338591b0e53ebb6a242d3e /t | |
parent | b6cb94c5b90e1d814bbb4b070425ee261df0ce7e (diff) | |
download | perl-5731662b7617da2ff1626044f081de38b50a0ddc.tar.gz |
Make -T HANDLE set the last stat type
This was brought up in bug #77388.
Diffstat (limited to 't')
-rw-r--r-- | t/op/filetest.t | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/t/op/filetest.t b/t/op/filetest.t index d013cce327..5cc83d7107 100644 --- a/t/op/filetest.t +++ b/t/op/filetest.t @@ -10,7 +10,7 @@ BEGIN { } use Config; -plan(tests => 34 + 27*14); +plan(tests => 35 + 27*14); ok( -d 'op' ); ok( -f 'TEST' ); @@ -247,3 +247,13 @@ for my $op (split //, "rwxoRWXOezsfdlpSbctugkTMBAC") { push my @a, $t, -t; is $w, 1, 'file test does not call FETCH on stack item not its own'; } + +# Test that -T HANDLE sets the last stat type +SKIP: { + skip "no -T on filehandles", 1 unless eval { -T STDERR; 1 }; + -l "perl.c"; # last stat type is now lstat + -T STDERR; # should set it to stat, since -T does a stat + eval { -l _ }; # should die, because the last stat type is not lstat + like $@, qr/^The stat preceding -l _ wasn't an lstat at /, + '-T HANDLE sets the stat type'; +} |