From: Jarkko Hietaniemi Date: Mon, 7 Jul 2003 13:23:58 +0000 (+0000) Subject: If perlio is completely out of the picture, we can X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f183cb219ecce20aeebdfc5d56782bfea3310804;p=p5sagit%2Fp5-mst-13.2.git If perlio is completely out of the picture, we can get tripped by different stdio implementations. p4raw-id: //depot/perl@20055 --- diff --git a/ext/Digest/MD5/t/badfile.t b/ext/Digest/MD5/t/badfile.t index 32fc6fe..2292341 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; @@ -21,11 +22,17 @@ eval { print "not " unless $@ =~ /^No filehandle passed at/; print "ok 2\n"; +# Some stdio implementations don't gripe about reading from write-only +# filehandles, so if we are using stdio (which means either pre-perlio +# Perl, or perlio-Perl configured to have no perlio), we can't expect +# to get the right error. +my $stdio = !exists $Config{useperlio} || !defined $Config{useperlio}; + open(BAR, ">no-existing-file.$$") || die; eval { $md5->addfile(*BAR); }; -print "not " unless $@ =~ /^Reading from filehandle failed at/; +print "not " unless $@ =~ /^Reading from filehandle failed at/ || $stdio; print "ok 3\n"; close(BAR);