diff options
author | Nicholas Clark <nick@ccl4.org> | 2003-12-27 17:24:27 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2003-12-27 17:24:27 +0000 |
commit | e19eb3c1189f80471d9e8bc1bac9bafb84e853ef (patch) | |
tree | 2bd1f5331bf1196b38904b25bcbf530030a6b92f /lib/Digest | |
parent | a9939470558f41efaae5bf23fe0c76fc3a2402ea (diff) | |
download | perl-e19eb3c1189f80471d9e8bc1bac9bafb84e853ef.tar.gz |
Assimilate Digest 1.05
p4raw-id: //depot/perl@21973
Diffstat (limited to 'lib/Digest')
-rw-r--r-- | lib/Digest/t/digest.t | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/lib/Digest/t/digest.t b/lib/Digest/t/digest.t index fbc2dac805..c5da8f02c8 100644 --- a/lib/Digest/t/digest.t +++ b/lib/Digest/t/digest.t @@ -2,22 +2,35 @@ print "1..3\n"; use Digest; -my $hexdigest = "900150983cd24fb0d6963f7d28e17f72"; # ASCII +{ + package Digest::Dummy; + use vars qw($VERSION @ISA); + $VERSION = 1; -if (ord('A') == 193) { # EBCDIC - $hexdigest = "fe4ea0d98f9cd8d1d27f102a93cb0bb0"; # IBM-1047 + require Digest::base; + @ISA = qw(Digest::base); + + sub new { + my $class = shift; + my $d = shift || "ooo"; + bless { d => $d }, $class; + } + sub add {} + sub digest { shift->{d} } } -print "not " unless Digest->MD5->add("abc")->hexdigest eq $hexdigest; +my $d; +$d = Digest->new("Dummy"); +print "not " unless $d->digest eq "ooo"; print "ok 1\n"; -print "not " unless Digest->MD5->add("abc")->hexdigest eq $hexdigest; +$d = Digest->Dummy; +print "not " unless $d->digest eq "ooo"; print "ok 2\n"; -eval { - # Not yet EBCDICified. - print "not " unless Digest->new("HMAC-MD5" => "Jefe")->add("what do ya want for nothing?")->hexdigest eq "750c783e6ab0b503eaa86e310a5db738"; - print "ok 3\n"; -}; -print "ok 3\n" if $@ && $@ =~ /^Can't locate/; +$Digest::MMAP{"Dummy-24"} = [["NotThere"], "NotThereEither", ["Digest::Dummy", 24]]; +$d = Digest->new("Dummy-24"); +print "not " unless $d->digest eq "24"; +print "ok 3\n"; + |