From: Jarkko Hietaniemi Date: Mon, 4 Mar 2002 23:48:07 +0000 (+0000) Subject: One more nit from mjd. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f394ef5ea6476a08603d49b0bf9274140bfda7cf;p=p5sagit%2Fp5-mst-13.2.git One more nit from mjd. p4raw-id: //depot/perl@15027 --- diff --git a/lib/Tie/File/t/16_handle.t b/lib/Tie/File/t/16_handle.t index e530dd9..cb9aa60 100644 --- a/lib/Tie/File/t/16_handle.t +++ b/lib/Tie/File/t/16_handle.t @@ -78,19 +78,34 @@ undef $o; untie @a; # Does it correctly detect a non-seekable handle? -{ eval {pipe *R, *W}; - close R; - if ($@) { - print "ok $N # skipped\n"; - last; - } - $o = eval {tie @a, 'Tie::File', \*W}; - if ($@ && $@ =~ /filehandle does not appear to be seekable/) { - print "ok $N\n"; - } else { - print "not ok $N # $@\n"; - } - $N++; + +{ + if ($^O =~ /^(MSWin32|dos)$/) { + print "ok $N \# skipped ($^O has broken pipe semantics)\n"; + last; + } + my $pipe_succeeded = eval {pipe *R, *W}; + if ($@) { + chomp $@; + print "ok $N \# skipped (no pipes: $@)\n"; + last; + } elsif (! $pipe_succeeded) { + print "ok $N \# skipped (pipe call failed: $!)\n"; + last; + } + close R; + $o = eval {tie @a, 'Tie::File', \*W}; + if ($@) { + if ($@ =~ /filehandle does not appear to be seekable/) { + print "ok $N\n"; + } else { + chomp $@; + print "not ok $N \# \$\@ is $@\n"; + } + } else { + print "not ok $N \# passing pipe to TIEARRAY didn't abort program\n"; + } + $N++; } # try inserting a record into the middle of an empty file