Integrate perlio:
[p5sagit/p5-mst-13.2.git] / t / lib / md5-badf.t
CommitLineData
3357b1b1 1BEGIN {
2 chdir 't' if -d 't';
3 @INC = '../lib';
4}
5
6# Digest::MD5 2.07 and older used to trigger a core dump when
7# passed an illegal file handle that failed to open.
8
9print "1..2\n";
10
11use Digest::MD5 ();
12
13$md5 = Digest::MD5->new;
14
15eval {
16 use vars qw(*FOO);
17 $md5->addfile(*FOO);
18};
19print "not " unless $@ =~ /^Bad filehandle: FOO/;
20print "ok 1\n";
21
22open(BAR, "none-existing-file.$$");
23$md5->addfile(*BAR);
24
25print "not " unless $md5->hexdigest eq "d41d8cd98f00b204e9800998ecf8427e";
26print "ok 2\n";