Change 20055 by [EMAIL PROTECTED] on 2003/07/07 13:23:58

        If perlio is completely out of the picture, we can
        get tripped by different stdio implementations.

Affected files ...

... //depot/perl/ext/Digest/MD5/t/badfile.t#4 edit

Differences ...

==== //depot/perl/ext/Digest/MD5/t/badfile.t#4 (text) ====
Index: perl/ext/Digest/MD5/t/badfile.t
--- perl/ext/Digest/MD5/t/badfile.t#3~20020~    Sat Jul  5 12:12:21 2003
+++ perl/ext/Digest/MD5/t/badfile.t     Mon Jul  7 06:23:58 2003
@@ -4,6 +4,7 @@
 print "1..3\n";
 
 use Digest::MD5 ();
+use Config;
 
 $md5 = Digest::MD5->new;
 
@@ -21,11 +22,17 @@
 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);
End of Patch.

Reply via email to