Now that binmode(FH) does implicit ":bytes" revisit
[p5sagit/p5-mst-13.2.git] / ext / Digest / MD5 / t / badfile.t
CommitLineData
3357b1b1 1# Digest::MD5 2.07 and older used to trigger a core dump when
2# passed an illegal file handle that failed to open.
3
4print "1..2\n";
5
6use Digest::MD5 ();
7
8$md5 = Digest::MD5->new;
9
10eval {
11 use vars qw(*FOO);
12 $md5->addfile(*FOO);
13};
14print "not " unless $@ =~ /^Bad filehandle: FOO/;
15print "ok 1\n";
16
17open(BAR, "none-existing-file.$$");
18$md5->addfile(*BAR);
19
20print "not " unless $md5->hexdigest eq "d41d8cd98f00b204e9800998ecf8427e";
21print "ok 2\n";