From: Steve Peters Date: Sun, 30 Jul 2006 17:03:10 +0000 (+0000) Subject: Tests to go with change #28628. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=586251be069c5ad776194c01de317f0a5ac37c08;p=p5sagit%2Fp5-mst-13.2.git Tests to go with change #28628. p4raw-link: @28628 on //depot/perl: ad02613cb6d8974aab9c68839c06129c8510c983 p4raw-id: //depot/perl@28632 --- diff --git a/t/op/stat.t b/t/op/stat.t index dac326a..86d100b 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 {