From: Jarkko Hietaniemi Date: Mon, 7 Jul 2003 14:12:27 +0000 (+0000) Subject: Refashioned #20055: we cannot trust stdio to fail here. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=42a96e2f9443f3338945ea4f77f6513fa81ee690;p=p5sagit%2Fp5-mst-13.2.git Refashioned #20055: we cannot trust stdio to fail here. p4raw-id: //depot/perl@20058 --- diff --git a/ext/Digest/MD5/t/badfile.t b/ext/Digest/MD5/t/badfile.t index 32fc6fe..90a7857 100644 --- a/ext/Digest/MD5/t/badfile.t +++ b/ext/Digest/MD5/t/badfile.t @@ -4,6 +4,7 @@ print "1..3\n"; use Digest::MD5 (); +use Config; $md5 = Digest::MD5->new; @@ -25,7 +26,13 @@ open(BAR, ">no-existing-file.$$") || die; eval { $md5->addfile(*BAR); }; -print "not " unless $@ =~ /^Reading from filehandle failed at/; +# Some stdio implementations don't find reading from +# write-only filehandle to be a problem. Therefore we +# cannot expect this to fail reliably with stdio. +my $stdio = !exists $Config{useperlio} || + !defined $Config{useperlio} || + (exists $ENV{PERLIO} && $ENV{PERLIO} eq 'stdio'); +print "not " unless $@ =~ /^Reading from filehandle failed at/ || $stdio; print "ok 3\n"; close(BAR);