summaryrefslogtreecommitdiff
path: root/t/op/stat.t
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2002-01-31 15:37:52 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2002-01-31 15:27:49 +0000
commit5c9aa243fcc1509167c9708b74c0f9451983e63b (patch)
tree3836db23368a8eaf52251f153213bdf99408780a /t/op/stat.t
parent62961d2e50d22e7ae5a679eac7bf6d593193e108 (diff)
downloadperl-5c9aa243fcc1509167c9708b74c0f9451983e63b.tar.gz
forbid -l _ after -T _
Message-ID: <20020131143752.A1452@rafael> p4raw-id: //depot/perl@14506
Diffstat (limited to 't/op/stat.t')
-rwxr-xr-xt/op/stat.t32
1 files changed, 31 insertions, 1 deletions
diff --git a/t/op/stat.t b/t/op/stat.t
index c3bbe8362d..2f387198f0 100755
--- a/t/op/stat.t
+++ b/t/op/stat.t
@@ -9,7 +9,7 @@ BEGIN {
use Config;
use File::Spec;
-plan tests => 69;
+plan tests => 74;
my $Perl = which_perl();
@@ -376,3 +376,33 @@ unlink $tmpfile or print "# unlink failed: $!\n";
# bug id 20011101.069
my @r = \stat(".");
is(scalar @r, 13, 'stat returns full 13 elements');
+
+SKIP: {
+ skip "No lstat", 2 unless $Config{d_lstat};
+
+ stat $0;
+ eval { lstat _ };
+ ok( $@ =~ /^The stat preceding lstat\(\) wasn't an lstat/,
+ 'lstat _ croaks after stat' );
+ eval { -l _ };
+ ok( $@ =~ /^The stat preceding -l _ wasn't an lstat/,
+ '-l _ croaks after stat' );
+
+ eval { lstat STDIN };
+ ok( $@ =~ /^The stat preceding lstat\(\) wasn't an lstat/,
+ 'lstat FILEHANDLE croaks' );
+
+ # bug id 20020124.004
+ # If we have d_lstat, we should have symlink()
+ my $linkname = 'dolzero';
+ symlink $0, $linkname or die "# Can't symlink $0: $!";
+ lstat $linkname;
+ -T _;
+ eval { lstat _ };
+ ok( $@ =~ /^The stat preceding lstat\(\) wasn't an lstat/,
+ 'lstat croaks after -T _' );
+ eval { -l _ };
+ ok( $@ =~ /^The stat preceding -l _ wasn't an lstat/,
+ '-l _ croaks after -T _' );
+ unlink $linkname or print "# unlink $linkname failed: $!\n";
+}