summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorSteve Peters <steve@fisharerojo.org>2006-07-30 17:03:10 +0000
committerSteve Peters <steve@fisharerojo.org>2006-07-30 17:03:10 +0000
commit586251be069c5ad776194c01de317f0a5ac37c08 (patch)
treea117694ea8a809edbb53da0a5bf41e401728e207 /t
parented84aac994553b92aff03a46f3a7be7248eb5fab (diff)
downloadperl-586251be069c5ad776194c01de317f0a5ac37c08.tar.gz
Tests to go with change #28628.
p4raw-link: @28628 on //depot/perl: ad02613cb6d8974aab9c68839c06129c8510c983 p4raw-id: //depot/perl@28632
Diffstat (limited to 't')
-rwxr-xr-xt/op/stat.t26
1 files changed, 23 insertions, 3 deletions
diff --git a/t/op/stat.t b/t/op/stat.t
index dac326aff0..86d100b427 100755
--- a/t/op/stat.t
+++ b/t/op/stat.t
@@ -9,7 +9,7 @@ BEGIN {
use Config;
use File::Spec;
-plan tests => 88;
+plan tests => 95;
my $Perl = which_perl();
@@ -481,9 +481,29 @@ ok(unlink($f), 'unlink tmp file');
SKIP: {
skip "No dirfd()", 2 unless $Config{d_dirfd};
- opendir my $dir, "." or die 'Unable to opendir ".": $!';
- ok(stat($dir), "stat() on dirhandle works");
+ ok(opendir(DIR, "."), 'Can open "." dir') || diag "Can't open '.': $!";
+ ok(stat(DIR), "stat() on dirhandle works");
ok(-d -r _ , "chained -x's on dirhandle");
+ closedir DIR;
+}
+
+{
+ # RT #8244: *FILE{IO} does not behave like *FILE for stat() and -X() operators
+ ok(open(F, ">", $tmpfile), 'can create temp file');
+ my @thwap = stat *F{IO};
+ ok(@thwap, "stat(*F{IO}) works");
+ ok( -f *F{IO} , "single file tests work with *F{IO}");
+ unlink $tmpfile;
+
+ #PVIO's hold dirhandle information, so let's test them too.
+
+ SKIP: {
+ skip "No dirfd()", 2 unless $Config{d_dirfd};
+ ok(opendir(DIR, "."), 'Can open "." dir') || diag "Can't open '.': $!";
+ ok(stat(*DIR{IO}), "stat() on *DIR{IO} works");
+ ok(-d -r *DIR{IO} , "chained -x's on *DIR{IO}");
+ closedir DIR;
+ }
}
END {