/[Biblio-Isis]/trunk/t/002_isis.t
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/t/002_isis.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 28 by dpavlin, Sat Jan 1 22:29:49 2005 UTC revision 33 by dpavlin, Wed Jan 5 21:23:04 2005 UTC
# Line 9  use Test::More tests => 110; Line 9  use Test::More tests => 110;
9    
10  BEGIN { use_ok( 'IsisDB' ); }  BEGIN { use_ok( 'IsisDB' ); }
11    
12    my $debug = shift @ARGV;
13  my $isis;  my $isis;
14    
15  sub test_data {  sub test_data {
# Line 17  sub test_data { Line 18  sub test_data {
18    
19          isa_ok ($isis, 'IsisDB');          isa_ok ($isis, 'IsisDB');
20    
21          cmp_ok($isis->{maxmfn}, '==', 5, "maxmfn set to 5");          cmp_ok($isis->count, '==', 5, "count is 5");
22    
23          # test .CNT data          # test .CNT data
24    
# Line 92  sub test_data { Line 93  sub test_data {
93                  '200' => [ '1#^aPsychology^fCamille B. Wortman, Elizabeth F. Loftus, Mary E. Marshal' ],                  '200' => [ '1#^aPsychology^fCamille B. Wortman, Elizabeth F. Loftus, Mary E. Marshal' ],
94          } ];          } ];
95                                    
96          foreach my $mfn (1 .. $isis->{'maxmfn'}) {          foreach my $mfn (1 .. $isis->count) {
97                  my $rec;                  my $rec;
98                  ok($rec = $isis->fetch($mfn), "fetch $mfn");                  ok($rec = $isis->fetch($mfn), "fetch $mfn");
99    
# Line 113  sub test_data { Line 114  sub test_data {
114    
115                  skip "no Digest::MD5 module", 5 if ($@);                  skip "no Digest::MD5 module", 5 if ($@);
116    
117                  foreach my $mfn (1 .. $isis->{'maxmfn'}) {                  foreach my $mfn (1 .. $isis->count) {
118                          my $md5 = md5_hex($isis->to_ascii($mfn));                          my $md5 = md5_hex($isis->to_ascii($mfn));
119                          cmp_ok($md5, 'eq', $args->{md5_ascii}[$mfn - 1], "md5 $mfn");                          cmp_ok($md5, 'eq', $args->{md5_ascii}[$mfn - 1], "md5 $mfn");
120                  }                  }
# Line 124  sub test_data { Line 125  sub test_data {
125  $isis = IsisDB->new (  $isis = IsisDB->new (
126          isisdb => './data/winisis/BIBL',          isisdb => './data/winisis/BIBL',
127          include_deleted => 1,          include_deleted => 1,
128            debug => $debug,
129  );  );
130    
131  print Dumper($isis);  print Dumper($isis);
# Line 166  cmp_ok($isis->{deleted}, '==', 3, "MFN 3 Line 168  cmp_ok($isis->{deleted}, '==', 3, "MFN 3
168    
169  $isis = IsisDB->new (  $isis = IsisDB->new (
170          isisdb => './data/winisis/BIBL',          isisdb => './data/winisis/BIBL',
171            debug => $debug,
172  );  );
173    
174  ok(! $isis->fetch(3), "deleted not found");  ok(! $isis->fetch(3), "deleted not found");

Legend:
Removed from v.28  
changed lines
  Added in v.33

  ViewVC Help
Powered by ViewVC 1.1.26