source: trunk/essentials/dev-lang/perl/lib/Digest/t/digest.t

Last change on this file was 3181, checked in by bird, 19 years ago

perl 5.8.8

File size: 650 bytes
Line 
1print "1..3\n";
2
3use Digest;
4
5{
6 package Digest::Dummy;
7 use vars qw($VERSION @ISA);
8 $VERSION = 1;
9
10 require Digest::base;
11 @ISA = qw(Digest::base);
12
13 sub new {
14 my $class = shift;
15 my $d = shift || "ooo";
16 bless { d => $d }, $class;
17 }
18 sub add {}
19 sub digest { shift->{d} }
20}
21
22my $d;
23$d = Digest->new("Dummy");
24print "not " unless $d->digest eq "ooo";
25print "ok 1\n";
26
27$d = Digest->Dummy;
28print "not " unless $d->digest eq "ooo";
29print "ok 2\n";
30
31$Digest::MMAP{"Dummy-24"} = [["NotThere"], "NotThereEither", ["Digest::Dummy", 24]];
32$d = Digest->new("Dummy-24");
33print "not " unless $d->digest eq "24";
34print "ok 3\n";
35
36
Note: See TracBrowser for help on using the repository browser.