From 889063c0c9ef8b23d3717fb3fdefad9cd730f695 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 29 Jul 2014 16:09:18 -0300 Subject: [PATCH] [PASSED QA] 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 --- t/db_dependent/Biblio.t | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/t/db_dependent/Biblio.t b/t/db_dependent/Biblio.t index 901f761..f53b6a5 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; }; -- 1.7.2.5