/[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 16 by dpavlin, Thu Jun 21 10:23:12 2007 UTC revision 18 by dpavlin, Mon Oct 29 22:33:35 2007 UTC
# Line 3  Line 3 
3  use strict;  use strict;
4  use blib;  use blib;
5    
6  use Test::More tests => 40;  use Test::More tests => 53;
7  use Test::Exception;  use Test::Exception;
8    
9  BEGIN {  BEGIN {
# Line 36  SKIP: { Line 36  SKIP: {
36    
37          #diag Dumper($marc);          #diag Dumper($marc);
38    
39          cmp_ok($marc->count, '==', scalar @{$marc->{leaders}}, "count == leaders");          cmp_ok($marc->count, '==', scalar @{$marc->{leader}}, "count == leader");
40          cmp_ok($marc->count, '==', scalar @{$marc->{fh_offset}}, "count == fh_offset");          cmp_ok($marc->count, '==', scalar @{$marc->{fh_offset}}, "count == fh_offset");
41    
42          ok(! $marc->fetch(0), "fetch 0");          ok(! $marc->fetch(0), "fetch 0");
43            ok(! $marc->last_leader, "no last_leader");
44          ok($marc->fetch($marc->count), "fetch max:".$marc->count);          ok($marc->fetch($marc->count), "fetch max:".$marc->count);
45          ok(! $marc->fetch($marc->count + 1), "fetch max+1:".($marc->count+1));          ok(! $marc->fetch($marc->count + 1), "fetch max+1:".($marc->count+1));
46    
47          foreach (1 .. 10) {          foreach (1 .. 10) {
48                  ok($marc->fetch($_), "fetch $_");                  ok($marc->fetch($_), "fetch $_");
49    
50                    ok($marc->last_leader, "last_leader $_");
51    
52                  ok(my $hash = $marc->to_hash($_), "to_hash $_");                  ok(my $hash = $marc->to_hash($_), "to_hash $_");
53                  diag "to_hash($_) = ",Data::Dump::dump($hash) if ($debug);                  diag "to_hash($_) = ",Data::Dump::dump($hash) if ($debug);
54                  ok(my $ascii = $marc->to_ascii($_), "to_ascii $_");                  ok(my $ascii = $marc->to_ascii($_), "to_ascii $_");
55                  diag "to_ascii($_) ::\n$ascii" if ($debug);                  diag "to_ascii($_) ::\n$ascii" if ($debug);
56          }          }
57    
58            ok(! $marc->fetch(0), "fetch 0 again");
59            ok(! $marc->last_leader, "no last_leader");
60  }  }

Legend:
Removed from v.16  
changed lines
  Added in v.18

  ViewVC Help
Powered by ViewVC 1.1.26