summaryrefslogtreecommitdiff
path: root/ext/Digest
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-07-07 13:23:58 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-07-07 13:23:58 +0000
commitf183cb219ecce20aeebdfc5d56782bfea3310804 (patch)
treef00aaeb10a92fd840d0b242f3f14df41c9e7b7fe /ext/Digest
parent81a5ca8da528989343387739fed953b1d13f12ba (diff)
downloadperl-f183cb219ecce20aeebdfc5d56782bfea3310804.tar.gz
If perlio is completely out of the picture, we can
get tripped by different stdio implementations. p4raw-id: //depot/perl@20055
Diffstat (limited to 'ext/Digest')
-rw-r--r--ext/Digest/MD5/t/badfile.t9
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/Digest/MD5/t/badfile.t b/ext/Digest/MD5/t/badfile.t
index 32fc6fef7c..2292341b8f 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);