/[MARC-Fast]/trunk/t/001_marc.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/001_marc.t

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

revision 1 by dpavlin, Tue Jan 4 10:26:07 2005 UTC revision 2 by dpavlin, Tue Jan 4 15:32:54 2005 UTC
# Line 18  $param{marcdb} = '/foo/bar/file'; Line 18  $param{marcdb} = '/foo/bar/file';
18    
19  throws_ok { $marc = MARC::Fast->new(%param); } qr/foo.bar/, "marcdb exist";  throws_ok { $marc = MARC::Fast->new(%param); } qr/foo.bar/, "marcdb exist";
20    
21  $param{marcdb} = '../unimarc.iso';  $param{marcdb} = 'data/unimarc.iso';
22    
23  ok($marc = MARC::Fast->new(%param), "new");  SKIP: {
24            skip "no ",$param{marcdb}," test file ", 18 unless (-e $param{marcdb});
25    
26  isa_ok ($marc, 'MARC::Fast');          ok($marc = MARC::Fast->new(%param), "new");
27    
28  cmp_ok($marc->count, '==', scalar @{$marc->{leaders}}, "count == leaders");          isa_ok ($marc, 'MARC::Fast');
 cmp_ok($marc->count, '==', scalar @{$marc->{fh_offset}}, "count == fh_offset");  
29    
30  ok(! $marc->fetch(0), "fetch 0");          cmp_ok($marc->count, '==', scalar @{$marc->{leaders}}, "count == leaders");
31  ok($marc->fetch($marc->count), "fetch max:".$marc->count);          cmp_ok($marc->count, '==', scalar @{$marc->{fh_offset}}, "count == fh_offset");
 ok(! $marc->fetch($marc->count + 1), "fetch max+1:".($marc->count+1));  
32    
33  foreach (1 .. 10) {          ok(! $marc->fetch(0), "fetch 0");
34          ok($marc->fetch($_), "fetch $_");          ok($marc->fetch($marc->count), "fetch max:".$marc->count);
35  }          ok(! $marc->fetch($marc->count + 1), "fetch max+1:".($marc->count+1));
36    
37            foreach (1 .. 10) {
38                    ok($marc->fetch($_), "fetch $_");
39            }
40    }

Legend:
Removed from v.1  
changed lines
  Added in v.2

  ViewVC Help
Powered by ViewVC 1.1.26