981a551844e4c8e32e53fc3ef64400cdd79f6ff2
[MARC-Fast] / t / 003_marc-repeatable.t
1 #!/usr/bin/perl -w
2
3 use strict;
4 use lib 'lib';
5
6 use Test::More tests => 7;
7 use Data::Dump qw/dump/;
8
9 BEGIN {
10         use_ok( 'MARC::Fast' );
11         use_ok( 'Encode' );
12 }
13
14 my $debug = shift @ARGV;
15
16 my $marc_file = 't/koha-105405.mrc';
17
18 ok(my $marc = MARC::Fast->new(
19         marcdb => $marc_file,
20 ), "new");
21
22 cmp_ok($marc->count, '==', 1, 'count' );
23
24 ok(my $rec = $marc->fetch(1), "fetch 1");
25 diag dump $rec if $debug;
26
27 ok(my $hash = $marc->to_hash(1, include_subfields => 1), "to_hash 1 include_subfields");
28 diag dump $hash if $debug;
29
30 isa_ok( $hash->{653}->[0]->{'a'}, 'ARRAY' );
31