From: Tony Cook Date: Tue, 20 Mar 2012 06:35:42 +0000 (+1100) Subject: [perl #111638] TODO for -p on a File::stat object X-Git-Tag: upstream/5.20.0~6826 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e0b1616f85224b731a379bf9969db48ca60be80a;p=platform%2Fupstream%2Fperl.git [perl #111638] TODO for -p on a File::stat object --- diff --git a/lib/File/stat.t b/lib/File/stat.t index 32a7481..382f43e 100644 --- a/lib/File/stat.t +++ b/lib/File/stat.t @@ -42,7 +42,7 @@ BEGIN { our @stat = stat $file; # This is the function stat. unless (@stat) { plan skip_all => "1..0 # Skip: no file $file"; exit 0 } -plan tests => 19 + 24*2 + 4 + 3 + 7; +plan tests => 19 + 24*2 + 4 + 3 + 7 + 2; use_ok( 'File::stat' ); @@ -159,6 +159,20 @@ SKIP: { } } +SKIP: +{ # RT #111638 + skip "We can't check for FIFOs", 2 unless defined &Fcntl::S_ISFIFO; + skip "No pipes", 2 unless defined $Config{d_pipe}; + pipe my ($rh, $wh) + or skip "Couldn't create a pipe: $!", 2; + skip "Built-in -p doesn't detect a pipe", 2 unless -p $rh; + + my $pstat = File::stat::stat($rh); + ok(!-p($stat), "-p should be false on a file"); + local $TODO = "RT #111638 -p overload broken"; + ok(-p($pstat), "check -p detects a pipe"); +} + local $!; $stat = stat '/notafile'; isnt( $!, '', 'should populate $!, given invalid file' );