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