Commit | Line | Data |
f70490b9 |
1 | print "1..3\n"; |
2 | |
3 | BEGIN { |
4 | chdir 't' if -d 't'; |
5 | @INC = '../lib'; |
6 | } |
7 | |
8 | use Digest; |
9 | |
10 | print "not " unless Digest->MD5->add("abc")->hexdigest eq "900150983cd24fb0d6963f7d28e17f72"; |
11 | print "ok 1\n"; |
12 | |
13 | print "not " unless Digest->MD5->add("abc")->hexdigest eq "900150983cd24fb0d6963f7d28e17f72"; |
14 | print "ok 2\n"; |
15 | |
16 | eval { |
17 | print "not " unless Digest->new("HMAC-MD5" => "Jefe")->add("what do ya want for nothing?")->hexdigest eq "750c783e6ab0b503eaa86e310a5db738"; |
18 | print "ok 3\n"; |
19 | }; |
20 | print "ok 3\n" if $@ && $@ =~ /^Can't locate/; |
21 | |