From f5b26fd0ce2978d06813cfe0814f587d9ca15085 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 29 Jul 2014 16:09:18 -0300 Subject: [PATCH] Bug 12674: (regression tests) GetMarcISSN should not return empty ISSN Proves GetMarcISSN returns empty ISSNs in the results array. To reproduce: - Run $ prove -v t/db_dependent/Biblio.t Signed-off-by: Jonathan Druart Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- t/db_dependent/Biblio.t | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t index 901f76134d..f53b6a5c29 100755 --- a/t/db_dependent/Biblio.t +++ b/t/db_dependent/Biblio.t @@ -143,6 +143,12 @@ sub run_tests { $issns = GetMarcISSN( $marc_record, $marcflavour ); is( scalar @$issns, 4, 'GetMARCISSN handles records with multiple ISSN fields (count correct)'); + # Create an empty ISSN + $field = create_issn_field( "", $marcflavour ); + $marc_record->append_fields($field); + $issns = GetMarcISSN( $marc_record, $marcflavour ); + is( scalar @$issns, 4, + 'GetMARCISSN skips empty ISSN fields (Bug 12674)'); ## Testing GetMarcControlnumber my $controlnumber; @@ -254,19 +260,19 @@ sub create_issn_field { } subtest 'MARC21' => sub { - plan tests => 26; + plan tests => 27; run_tests('MARC21'); $dbh->rollback; }; subtest 'UNIMARC' => sub { - plan tests => 26; + plan tests => 27; run_tests('UNIMARC'); $dbh->rollback; }; subtest 'NORMARC' => sub { - plan tests => 26; + plan tests => 27; run_tests('NORMARC'); $dbh->rollback; };