diff options
author | Tony Cook <tony@develop-help.com> | 2012-03-20 17:35:42 +1100 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2012-05-21 17:51:55 -0700 |
commit | e0b1616f85224b731a379bf9969db48ca60be80a (patch) | |
tree | f2bebc08d46b00efe42433753c93b0017a1dcf34 /lib/File | |
parent | 6469807424b3b12a40064fb2257df66bc91af2ec (diff) | |
download | perl-e0b1616f85224b731a379bf9969db48ca60be80a.tar.gz |
[perl #111638] TODO for -p on a File::stat object
Diffstat (limited to 'lib/File')
-rw-r--r-- | lib/File/stat.t | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/File/stat.t b/lib/File/stat.t index 32a7481535..382f43e425 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' ); |