/[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 21 by dpavlin, Fri Dec 31 00:46:33 2004 UTC revision 22 by dpavlin, Fri Dec 31 01:06:21 2004 UTC
# Line 5  use blib; Line 5  use blib;
5    
6  use Data::Dumper;  use Data::Dumper;
7    
8  use Test::More tests => 94;  use Test::More tests => 104;
9    
10  BEGIN { use_ok( 'IsisDB' ); }  BEGIN { use_ok( 'IsisDB' ); }
11    
# Line 90  sub test_data { Line 90  sub test_data {
90                  '200' => [ '1#^aPsychology^fCamille B. Wortman, Elizabeth F. Loftus, Mary E. Marshal' ],                  '200' => [ '1#^aPsychology^fCamille B. Wortman, Elizabeth F. Loftus, Mary E. Marshal' ],
91          } ];          } ];
92                                    
93          for (my $mfn = 1; $mfn <= $isis->{'maxmfn'}; $mfn++) {          foreach my $mfn (1 .. $isis->{'maxmfn'}) {
94                  my $rec;                  my $rec;
95                  ok($rec = $isis->fetch($mfn), "fetch $mfn");                  ok($rec = $isis->fetch($mfn), "fetch $mfn");
96    
# Line 102  sub test_data { Line 102  sub test_data {
102                                  $i++;                                  $i++;
103                          }                          }
104                  }                  }
105  #               print Dumper($rec);          }
106    
107            # test to_ascii
108    
109            SKIP: {
110                    eval "use Digest::MD5 qw(md5_hex)";
111    
112                    skip "no Digest::MD5 module", 5 if ($@);
113    
114                    foreach my $mfn (1 .. $isis->{'maxmfn'}) {
115                            my $md5 = md5_hex($isis->to_ascii($mfn));
116                            cmp_ok($args->{md5_ascii}[$mfn - 1], 'eq', $md5, "md5 $mfn");
117                    }
118          }          }
119    
120  }  }
# Line 113  $isis = IsisDB->new ( Line 125  $isis = IsisDB->new (
125    
126  print Dumper($isis);  print Dumper($isis);
127    
128  test_data( no_ident => 1 );  test_data(
129            no_ident => 1,
130            md5_ascii => [ qw(
131                    a369eff702307ba12eb81656ee0587fe
132                    4fb38537a94f3f5954e40d9536b942b0
133                    498cc16c9e7ab0fdc29182533cc35d11
134                    7d2adf1675c83283aa9b82bf343e3d85
135                    daf2cf86ca7e188e8360a185f3b43423
136            ) ],
137    );
138    
139  $isis = IsisDB->new (  $isis = IsisDB->new (
140          isisdb => './data/isismarc/BIBL',          isisdb => './data/isismarc/BIBL',
141  );  );
142    
143  test_data();  test_data(
144            md5_ascii => [ qw(
145                    f5587d9bcaa54257a98fe27d3c17a0b6
146                    3be9a049f686f2a36af93a856dcae0f2
147                    3961be5e3ba8fb274c89c08d18df4bcc
148                    5f73ec00d08af044a2c4105f7d889e24
149                    843b9ebccf16a498fba623c78f21b6c0
150            ) ],
151    );

Legend:
Removed from v.21  
changed lines
  Added in v.22

  ViewVC Help
Powered by ViewVC 1.1.26