From 7f90a4fb27ca06bbe39174b555f96445682a0c28 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 3 Jan 2014 15:54:45 +0000 Subject: [PATCH] Bug 11066: (follow-up) add regression test This patch adds a regression test for using the MARC21 264 field in the Bibtex export. To test: [1] Verify that prove -v t/db_dependent/Record.t passes. Signed-off-by: Galen Charlton --- t/db_dependent/Record.t | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/t/db_dependent/Record.t b/t/db_dependent/Record.t index 02bf8b1ada..34a47c0cc0 100755 --- a/t/db_dependent/Record.t +++ b/t/db_dependent/Record.t @@ -3,10 +3,9 @@ # This Koha test module is a stub! # Add more tests here!!! -use strict; -use warnings; +use Modern::Perl; -use Test::More tests => 10; +use Test::More tests => 11; use MARC::Record; BEGIN { @@ -89,6 +88,9 @@ $marc->append_fields(MARC::Field->new( )); my $field = MARC::Field->new('245','','','a' => "Harry potter"); $marc->append_fields($field); +$marc->append_fields(MARC::Field->new( + '260', ' ', ' ', b => 'Scholastic', c => '2001' +)); #my $endnote=marc2endnote($marc->as_usmarc); #print $endnote; @@ -96,12 +98,27 @@ $marc->append_fields($field); my $bibtex=marc2bibtex($marc, 'testID'); my $test5xml=qq(\@book{testID, author = {Rowling, J.K.}, - title = {Harry potter} + title = {Harry potter}, + publisher = {Scholastic}, + year = {2001} } ); is ($bibtex, $test5xml, "testing bibtex"); +$marc->append_fields(MARC::Field->new( + '264', '3', '1', b => 'Reprints', c => '2011' +)); +$bibtex = marc2bibtex($marc, 'testID'); +my $rdabibtex = qq(\@book{testID, + author = {Rowling, J.K.}, + title = {Harry potter}, + publisher = {Reprints}, + year = {2011} +} +); +is ($bibtex, $rdabibtex, "testing bibtex with RDA 264 field"); + my @entity=C4::Record::_entity_encode("Björn"); is ($entity[0], "Björn", "Html umlauts"); -- 2.39.5