From c1ad78f19abd2acfe09da7049d5c1be5948629dd Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Tue, 21 Jun 2011 23:31:01 -0400 Subject: [PATCH] Add unit tests for LP 800269 - holdings for captions only Running "prove -l lib" in Open-ILS/src/perlmods shows that the two new unit tests pass, whereas they fail using the previously installed version of MFHD.pm. Good evidence that the fix from dbwells does indeed solve the reported bug. Signed-off-by: Dan Scott --- Open-ILS/src/perlmods/t/14-OpenILS-Utils.t | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/t/14-OpenILS-Utils.t b/Open-ILS/src/perlmods/t/14-OpenILS-Utils.t index 70f988d852..f24e980419 100644 --- a/Open-ILS/src/perlmods/t/14-OpenILS-Utils.t +++ b/Open-ILS/src/perlmods/t/14-OpenILS-Utils.t @@ -1,6 +1,6 @@ #!perl -T -use Test::More tests => 17; +use Test::More tests => 19; use_ok( 'OpenILS::Utils::Cronscript' ); use_ok( 'OpenILS::Utils::CStoreEditor' ); @@ -19,3 +19,20 @@ use_ok( 'OpenILS::Utils::RemoteAccount' ); use_ok( 'OpenILS::Utils::ScriptRunner' ); use_ok( 'OpenILS::Utils::SpiderMonkey' ); use_ok( 'OpenILS::Utils::ZClient' ); + +# LP 800269 - Test MFHD holdings for records that only contain a caption field +my $co_marc = MARC::Record->new(); +$co_marc->append_fields( + MARC::Field->new('853','','', + '8' => '1', + 'a' => 'v.', + 'b' => '[no.]', + ) +); +my $co_mfhd = MFHD->new($co_marc); + +my @comp_holdings = $co_mfhd->get_compressed_holdings($co_mfhd->field('853')); +is(@comp_holdings, 0, "Compressed holdings for an MFHD record that only has a caption"); + +my @decomp_holdings = $co_mfhd->get_decompressed_holdings($co_mfhd->field('853')); +is(@decomp_holdings, 0, "Decompressed holdings for an MFHD record that only has a caption"); -- 2.11.0