6 use Digest::MD5 qw(md5_hex);
8 my $a = Digest::MD5->new;
12 print "not " unless $b->clone->hexdigest eq md5_hex("a");
16 print "not " unless $a->hexdigest eq md5_hex("aa");
19 print "not " unless $a->hexdigest eq md5_hex("");
23 print "not " unless $b->clone->hexdigest eq md5_hex("ab");
27 print "not " unless $b->clone->hexdigest eq md5_hex("abc");
30 # Test that cloning picks up the correct class for subclasses.
33 @MD5::ISA = qw(Digest::MD5);
40 print "not " unless ref($b) eq "MD5" && $b->add("b")->hexdigest eq md5_hex("ab");