3 |
use strict; |
use strict; |
4 |
use blib; |
use blib; |
5 |
|
|
6 |
use Test::More tests => 53; |
use Test::More tests => 63; |
7 |
use Test::Exception; |
use Test::Exception; |
8 |
|
|
9 |
BEGIN { |
BEGIN { |
50 |
ok(! $marc->fetch($marc->count + 1), "fetch max+1:".($marc->count+1)); |
ok(! $marc->fetch($marc->count + 1), "fetch max+1:".($marc->count+1)); |
51 |
|
|
52 |
foreach (1 .. 10) { |
foreach (1 .. 10) { |
53 |
ok($marc->fetch($_), "fetch $_"); |
ok($marc->fetch($_), "fetch($_)"); |
54 |
|
|
55 |
ok($marc->last_leader, "last_leader $_"); |
ok($marc->last_leader, "last_leader $_"); |
56 |
|
|
57 |
ok(my $hash = $marc->to_hash($_), "to_hash $_"); |
ok(my $hash = $marc->to_hash($_), "to_hash($_)"); |
58 |
diag "to_hash($_) = ",Data::Dump::dump($hash) if ($debug); |
diag "to_hash($_) = ",Data::Dump::dump($hash) if ($debug); |
59 |
ok(my $ascii = $marc->to_ascii($_), "to_ascii $_"); |
|
60 |
|
ok(my $hash_sf = $marc->to_hash($_, include_subfields => 1), "to_hash($_,include_subfields)"); |
61 |
|
diag "to_hash($_, include_subfields => 1) = ",Data::Dump::dump($hash_sf) if ($debug); |
62 |
|
|
63 |
|
ok(my $ascii = $marc->to_ascii($_), "to_ascii($_)"); |
64 |
diag "to_ascii($_) ::\n$ascii" if ($debug); |
diag "to_ascii($_) ::\n$ascii" if ($debug); |
65 |
} |
} |
66 |
|
|
67 |
ok(! $marc->fetch(0), "fetch 0 again"); |
ok(! $marc->fetch(0), "fetch(0) again"); |
68 |
ok(! $marc->last_leader, "no last_leader"); |
ok(! $marc->last_leader, "no last_leader"); |
69 |
} |
} |