From eec94e2b3979b427ee2bb064c76ed364f2d53568 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Thu, 23 Sep 2010 13:05:59 +0000 Subject: [PATCH] test repeatable subfields git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/MARC-Fast/trunk@40 49f9634a-d7ec-0310-8e6b-ec35c6cc8804 --- t/003_marc-repeatable.t | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100755 t/003_marc-repeatable.t diff --git a/t/003_marc-repeatable.t b/t/003_marc-repeatable.t new file mode 100755 index 0000000..981a551 --- /dev/null +++ b/t/003_marc-repeatable.t @@ -0,0 +1,31 @@ +#!/usr/bin/perl -w + +use strict; +use lib 'lib'; + +use Test::More tests => 7; +use Data::Dump qw/dump/; + +BEGIN { + use_ok( 'MARC::Fast' ); + use_ok( 'Encode' ); +} + +my $debug = shift @ARGV; + +my $marc_file = 't/koha-105405.mrc'; + +ok(my $marc = MARC::Fast->new( + marcdb => $marc_file, +), "new"); + +cmp_ok($marc->count, '==', 1, 'count' ); + +ok(my $rec = $marc->fetch(1), "fetch 1"); +diag dump $rec if $debug; + +ok(my $hash = $marc->to_hash(1, include_subfields => 1), "to_hash 1 include_subfields"); +diag dump $hash if $debug; + +isa_ok( $hash->{653}->[0]->{'a'}, 'ARRAY' ); + -- 2.20.1