From e0b1616f85224b731a379bf9969db48ca60be80a Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Tue, 20 Mar 2012 17:35:42 +1100 Subject: [PATCH] [perl #111638] TODO for -p on a File::stat object --- lib/File/stat.t | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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' ); -- 2.7.4