X-Git-Url: http://git.rot13.org/?p=MARC-Fast;a=blobdiff_plain;f=t%2F001_marc.t;h=990d0780fc6bfcffd5525a78ffaf50cfabb5f6b1;hp=3553dc346bc07a76873dab1e27d7d9d3caa62655;hb=12f18ad14a52dc83e3449d908fb0678e16dabb49;hpb=32a687e3527bec06b7a15ccceb53e6ba9f5d272a diff --git a/t/001_marc.t b/t/001_marc.t index 3553dc3..990d078 100755 --- a/t/001_marc.t +++ b/t/001_marc.t @@ -3,7 +3,7 @@ use strict; use blib; -use Test::More tests => 40; +use Test::More tests => 53; use Test::Exception; BEGIN { @@ -36,19 +36,25 @@ SKIP: { #diag Dumper($marc); - cmp_ok($marc->count, '==', scalar @{$marc->{leaders}}, "count == leaders"); + cmp_ok($marc->count, '==', scalar @{$marc->{leader}}, "count == leader"); cmp_ok($marc->count, '==', scalar @{$marc->{fh_offset}}, "count == fh_offset"); ok(! $marc->fetch(0), "fetch 0"); + ok(! $marc->last_leader, "no last_leader"); ok($marc->fetch($marc->count), "fetch max:".$marc->count); ok(! $marc->fetch($marc->count + 1), "fetch max+1:".($marc->count+1)); foreach (1 .. 10) { ok($marc->fetch($_), "fetch $_"); + ok($marc->last_leader, "last_leader $_"); + ok(my $hash = $marc->to_hash($_), "to_hash $_"); diag "to_hash($_) = ",Data::Dump::dump($hash) if ($debug); ok(my $ascii = $marc->to_ascii($_), "to_ascii $_"); diag "to_ascii($_) ::\n$ascii" if ($debug); } + + ok(! $marc->fetch(0), "fetch 0 again"); + ok(! $marc->last_leader, "no last_leader"); }