Bug 11066: (follow-up) add regression test
authorGalen Charlton <gmc@esilibrary.com>
Fri, 3 Jan 2014 15:54:45 +0000 (15:54 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Fri, 3 Jan 2014 15:54:45 +0000 (15:54 +0000)
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 <gmc@esilibrary.com>
t/db_dependent/Record.t

index 02bf8b1..34a47c0 100755 (executable)
@@ -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&#xC3;&#xB6;rn", "Html umlauts");